From c43009bbb3cdefccb1e67eb835dcebb87a68bdf2 Mon Sep 17 00:00:00 2001 From: jtbx Date: Mon, 8 Jun 2026 21:58:04 +0200 Subject: [PATCH] Theme: Fix doubled "Neuigkeiten" heading --- themes/ccchh/layouts/index.html | 15 ++++++--------- themes/ccchh/layouts/partials/blog-header.html | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/themes/ccchh/layouts/index.html b/themes/ccchh/layouts/index.html index c75d145..5963234 100644 --- a/themes/ccchh/layouts/index.html +++ b/themes/ccchh/layouts/index.html @@ -7,7 +7,12 @@ {{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }} {{- $lookback := time.ParseDuration "-6h" }} {{- $upcoming := where $events ".Params.date" "ge" (time.Now.Add $lookback) }} - {{ if $upcoming }} + + {{- $article := where (.Site.GetPage "blog").Pages ".Params.categories" "article" }} + {{- $articleDisplayTime := time.ParseDuration "-126h" }} + {{- $articleNew := where $article ".Params.publishDate" "ge" (time.Now.Add $articleDisplayTime) }} + + {{ if or $upcoming $articleNew }}

Neuigkeiten

{{- range $upcoming.ByDate }} @@ -24,15 +29,7 @@ {{- end }}
{{- end }} - - {{- end }} - {{- $article := where (.Site.GetPage "blog").Pages ".Params.categories" "article" }} - {{- $articleDisplayTime := time.ParseDuration "-126h" }} - {{- $articleNew := where $article ".Params.publishDate" "ge" (time.Now.Add $articleDisplayTime) }} - {{ if $articleNew }} -
-

Neuigkeiten

{{- range $articleNew.ByDate }}
{{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }} diff --git a/themes/ccchh/layouts/partials/blog-header.html b/themes/ccchh/layouts/partials/blog-header.html index eef7cba..05edaf5 100644 --- a/themes/ccchh/layouts/partials/blog-header.html +++ b/themes/ccchh/layouts/partials/blog-header.html @@ -14,7 +14,12 @@ {{- end }}
+ {{- if (eq .Params.categories "event") }} {{ .Date | time.Format "Mon, 2006-01-02 15:04" }} + {{- else }} + {{ .Date | time.Format "2006-01-02" }} + {{- end }} + {{- if (eq .Params.categories "event") }} {{- with .Params.location }} @@ -25,6 +30,7 @@ {{- end -}} {{- end }} + {{- end }} {{- if $showTags }} {{- with .Page.GetTerms "tags" }}