From 5da2f358e9507d6fef385c6fa053fd54c351af9f Mon Sep 17 00:00:00 2001 From: Ethan Marshall Date: Fri, 2 Aug 2024 00:33:05 +0100 Subject: [PATCH] Clean up and improve some layouts Adds tags and category shows to single pages. Adds dates to list pages. --- content/blog/hello-world/index.md | 3 ++- themes/risotto/layouts/_default/list.html | 2 +- themes/risotto/layouts/_default/single.html | 25 ++++++++++++++++++--- themes/risotto/layouts/blog/list.html | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/content/blog/hello-world/index.md b/content/blog/hello-world/index.md index 8d21bff..7d1bc92 100644 --- a/content/blog/hello-world/index.md +++ b/content/blog/hello-world/index.md @@ -2,7 +2,8 @@ title = 'Hello World' date = 2024-08-01T04:21:56+01:00 author = 'Ethan Marshall' -draft = false +categories = ['tech'] +tags = ['personal', 'web'] +++ Hello, world! This is my first testing post to see if this system will work. Nothing to see here! diff --git a/themes/risotto/layouts/_default/list.html b/themes/risotto/layouts/_default/list.html index 6966c31..f2ec835 100644 --- a/themes/risotto/layouts/_default/list.html +++ b/themes/risotto/layouts/_default/list.html @@ -5,7 +5,7 @@ diff --git a/themes/risotto/layouts/_default/single.html b/themes/risotto/layouts/_default/single.html index 23274ed..3cbbf79 100644 --- a/themes/risotto/layouts/_default/single.html +++ b/themes/risotto/layouts/_default/single.html @@ -10,13 +10,32 @@ {{define "aside" }} {{ if .Params.description }}

{{ .Params.description }}

{{ end }} - {{ if or (.Params.author) (.Params.date) }} + {{ if .Params.date }}

- {{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} - {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }} + {{ if .Date }}First Published {{ .Date.Format "2006-01-02" }}{{ end }}

{{ end }} + {{if .Params.categories }} +

+ Categories: [ + {{ range .Params.categories }} + {{ . }} + {{ end }} + ] +

+ {{ end }} + + {{if .Params.tags }} +

+ Tags: [ + {{ range .Params.tags }} + {{ . }} + {{ end }} + ] +

+ {{ end }} + {{ if and (.Params.toc) (.TableOfContents) }}
On this page: diff --git a/themes/risotto/layouts/blog/list.html b/themes/risotto/layouts/blog/list.html index af87fe3..9c650e5 100644 --- a/themes/risotto/layouts/blog/list.html +++ b/themes/risotto/layouts/blog/list.html @@ -7,7 +7,7 @@ {{ range .Pages }}
-

{{ .Title | markdownify }} - {{ .Date.Format "2 January 2006" }}

+

{{ .Title | markdownify }} -- {{ .Date.Format "2 January 2006" }}