From 998c07847b041217a3070b9287909f2e6f5b8f47 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 16 Oct 2021 11:32:50 -0400 Subject: themes/hugo-pt2021/layouts/_default/archive.html: add comments, add title, show post date --- themes/hugo-pt2021/layouts/_default/archive.html | 32 +++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'themes/hugo-pt2021/layouts/_default/archive.html') diff --git a/themes/hugo-pt2021/layouts/_default/archive.html b/themes/hugo-pt2021/layouts/_default/archive.html index 737fd94..5da6ae8 100644 --- a/themes/hugo-pt2021/layouts/_default/archive.html +++ b/themes/hugo-pt2021/layouts/_default/archive.html @@ -10,24 +10,50 @@
+ {{/* get all published posts */}} {{- $posts := where .Site.RegularPages "Section" "posts" -}} + + {{/* loop through posts by year */}} {{- range $posts.GroupByDate "2006" -}} + {{/* get year of first post (there will always be at least one) */}} {{- $head := index .Pages 0 -}} {{- $year := $head.Date.Format "2006" -}} -

{{$year}}

+ +

+ {{- $year -}} +

+ + {{- else -}} + {{/* no published posts */}} + No posts found. {{- end -}}
-- cgit v1.2.3