From f711d2c55587bb1551a7a2863d68ee83d528ee01 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 9 Feb 2019 03:53:40 -0600 Subject: [PATCH] Added list support with categories to theme * Updated site index * Added a portfolio page * Added a category support within listing pages * Added some weighting to the page links --- content/about.md | 1 + content/{_index.md => index.md} | 0 content/portfolio/_index.md | 6 ++++ content/portfolio/sothr-dot-com-website.md | 5 +++ themes/pure/layouts/_default/list.html | 42 ++++++++++++++++++++++ themes/pure/layouts/partials/head.html | 2 +- 6 files changed, 55 insertions(+), 1 deletion(-) rename content/{_index.md => index.md} (100%) create mode 100644 content/portfolio/_index.md create mode 100644 content/portfolio/sothr-dot-com-website.md diff --git a/content/about.md b/content/about.md index 55a1077..b198ad2 100644 --- a/content/about.md +++ b/content/about.md @@ -2,6 +2,7 @@ title: "About" date: 2019-02-08T23:42:14-06:00 type: "navLink" +weight: 1 --- [**sothr.com**](https://sothr.com) is in it's 3rd iteration, rewritten using the static site generator [Hugo](https://gohugo.io/) from the previous Refinery CMS branch. I don't update the site often enough to require a CMS style site, and I am no longer comfortable with the additional attack surface of such an application for a simple personal landing page. I've developed a custom Hugo theme based on [Pure.css](https://purecss.io/) which I find to be a refreshingly small css only layout library. diff --git a/content/_index.md b/content/index.md similarity index 100% rename from content/_index.md rename to content/index.md diff --git a/content/portfolio/_index.md b/content/portfolio/_index.md new file mode 100644 index 0000000..8172902 --- /dev/null +++ b/content/portfolio/_index.md @@ -0,0 +1,6 @@ +--- +title: "Portfolio" +type: "navLink" +weight: 10 +--- +The following are projects of mine that I've collected and written about. \ No newline at end of file diff --git a/content/portfolio/sothr-dot-com-website.md b/content/portfolio/sothr-dot-com-website.md new file mode 100644 index 0000000..e7f42e6 --- /dev/null +++ b/content/portfolio/sothr-dot-com-website.md @@ -0,0 +1,5 @@ +--- +title: "Sothr.com Website" +date: 2019-02-09T02:47:12-06:00 +category: "Personal Project" +--- \ No newline at end of file diff --git a/themes/pure/layouts/_default/list.html b/themes/pure/layouts/_default/list.html index e69de29..b9e6fba 100644 --- a/themes/pure/layouts/_default/list.html +++ b/themes/pure/layouts/_default/list.html @@ -0,0 +1,42 @@ +{{ define "main" }} +

{{.Title}}

+
+ + {{.Content}} +
+ {{ $has_categories := gt (len (first 1 (where .Pages ".Params.category" "ne" nil))) 0 }} + {{ $has_without_categories := gt (len (first 1 (where .Pages ".Params.category" "eq" nil))) 0 }} + + {{ if $has_categories }} + {{ range .Pages.GroupByParam "Category" }} +
+
+ {{ if .Key }} +

{{ .Key }}

+ {{ end }} + {{ range .Pages }} +
+ +
+ {{ end }} +
+
+ {{ end }} + {{ end }} + {{ if and $has_categories $has_without_categories }} +
+
+

Others:

+
+
+ {{ end }} + {{ range where .Pages ".Params.category" "==" nil }} +
+ +
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/themes/pure/layouts/partials/head.html b/themes/pure/layouts/partials/head.html index cea24d8..068a6b9 100644 --- a/themes/pure/layouts/partials/head.html +++ b/themes/pure/layouts/partials/head.html @@ -17,7 +17,7 @@
  • {{ .Site.Title }}
  • - {{ range where .Site.Pages "Type" "navLink" }} + {{ range where (sort .Site.Pages "Weight" "desc") "Type" "navLink"}}
  • {{ .Title }}
  • {{ end }}