From 4343550d785d8cce942ac5109aa9fdd9d9a70823 Mon Sep 17 00:00:00 2001 From: Joe Roe Date: Tue, 29 Aug 2023 10:11:16 +0200 Subject: [PATCH] Add descriptions to list template #55 --- NEWS.md | 1 + exampleSite/content/post/_index.md | 1 + layouts/_default/list.html | 4 ++++ layouts/post/list.html | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/NEWS.md b/NEWS.md index c8ec289..e3aa2d0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # risotto (development version) * Fix overflow of code blocks with line numbers (#41) +* Add descriptions to sidebar of list pages, where defined in the frontmatter of `_index.md` (#55) # risotto 0.3.0 diff --git a/exampleSite/content/post/_index.md b/exampleSite/content/post/_index.md index 8a084d9..e7eb988 100644 --- a/exampleSite/content/post/_index.md +++ b/exampleSite/content/post/_index.md @@ -2,5 +2,6 @@ aliases = ["posts", "articles", "blog", "showcase", "docs"] title = "Posts" author = "Hugo Authors" +description = "Example posts demonstrating hugo's markup features" tags = ["index"] +++ diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 37742ef..6966c31 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,3 +10,7 @@ {{ end }} + +{{define "aside" }} + {{ if .Params.description }}

{{ .Params.description }}

{{ end }} +{{ end }} diff --git a/layouts/post/list.html b/layouts/post/list.html index 027e282..658b1eb 100644 --- a/layouts/post/list.html +++ b/layouts/post/list.html @@ -20,3 +20,7 @@ {{ end }} {{ end }} + +{{define "aside" }} + {{ if .Params.description }}

{{ .Params.description }}

{{ end }} +{{ end }}