From afd12144e61dbaee5307c53cd1c9eeb4d55acfd8 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Tue, 30 Sep 2025 00:41:22 +0200 Subject: [PATCH] Refactor event handling in postCard and add event list layout --- layouts/event/list.html | 30 ++++++++++++++++++++++++++++++ layouts/partials/postCard.html | 7 ++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 layouts/event/list.html diff --git a/layouts/event/list.html b/layouts/event/list.html new file mode 100644 index 00000000..6b3fc1da --- /dev/null +++ b/layouts/event/list.html @@ -0,0 +1,30 @@ +{{- define "main" -}} +{{ $year := 30000 }} +{{ $dataYear := "" }} + +
+
+

{{ .Title }}

+
+
+ {{ range (site.Pages.GroupByParam "start").Reverse}} + + {{ $dataYear = (dateFormat "2006" .Key ) }} + + {{ if lt $dataYear $year }} + {{ $year = $dataYear }} +

{{ $year }}

+ {{ end }} + + {{/* create a list of posts for each month, with month as heading */}} + + {{ range .Pages }} + {{ partial "postCard" . }} + + {{ end }} {{/* end range .Pages */}} + + {{ end }} {{/* end range .Pages.GroupByDate "2006" */}} + +
+
+{{- end -}} diff --git a/layouts/partials/postCard.html b/layouts/partials/postCard.html index a4092051..9c758012 100644 --- a/layouts/partials/postCard.html +++ b/layouts/partials/postCard.html @@ -33,7 +33,12 @@ {{ end }} - {{if not (eq .Type "series") }} + {{if eq .Type "event" }} + + {{else if not (eq .Type "series") }}