diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2022-07-19 11:13:28 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2022-07-19 11:13:28 +0100 |
commit | f916fc4e7902308d1b499ed5f37d519446dbe7dd (patch) | |
tree | 6ec0c868c2271e47e11678250bd477899974d0d6 /themes | |
parent | 6808489f1bf0f653859bc46136d4b74bf7ce8570 (diff) |
first implementation of blog posts sorted by category
Diffstat (limited to 'themes')
-rw-r--r-- | themes/problematic/layouts/_default/li.html | 2 | ||||
-rw-r--r-- | themes/problematic/layouts/partials/posts.html | 22 |
2 files changed, 17 insertions, 7 deletions
diff --git a/themes/problematic/layouts/_default/li.html b/themes/problematic/layouts/_default/li.html index 846ff3f..d0217b9 100644 --- a/themes/problematic/layouts/_default/li.html +++ b/themes/problematic/layouts/_default/li.html @@ -1,6 +1,6 @@ <li> <a href="{{ .Permalink }}"> {{ .Title }} - <small>(<time>{{ .Date.Format "2 January 2006" }}</time>)</small> + (<time>{{ .Date.Format "2 January 2006" }}</time>) </a> </li> diff --git a/themes/problematic/layouts/partials/posts.html b/themes/problematic/layouts/partials/posts.html index 8ff3eb2..191f449 100644 --- a/themes/problematic/layouts/partials/posts.html +++ b/themes/problematic/layouts/partials/posts.html @@ -1,6 +1,16 @@ -<h3>Posts</h3> -<ul id="posts"> -{{- range where site.RegularPages "Type" "in" site.Params.mainSections }} - {{ .Render "li" }} -{{- end }} -</ul> +<h2>Blog Posts</h2> + +{{ range $key, $value := .Site.Taxonomies.categories }} + + <h3>{{ $key | title }}</h3> + + <ul> + + {{ range where site.RegularPages ".Params.categories" "intersect" (slice ($key |title)) }} + <li><a href="{{ .Permalink }}">{{ .Title }}</a></li> + {{ end }} + + </ul> + +{{ end }} + |