From 7e29bd5369eb87381c0ab638ebb78cb440ffb518 Mon Sep 17 00:00:00 2001 From: jtbx Date: Sat, 2 Mar 2024 22:22:42 +0100 Subject: [PATCH] Theme: Keep current event for 6 hours after start date Events are shown in the "Neuigkeiten" section until their start date has been reached. As we deploy quite often, this means, that the currently running event will disappear when it's still going. As we don't know the end date, just show them for 6 more hours. --- themes/ccchh/layouts/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/ccchh/layouts/index.html b/themes/ccchh/layouts/index.html index de777ea..648d077 100644 --- a/themes/ccchh/layouts/index.html +++ b/themes/ccchh/layouts/index.html @@ -5,7 +5,8 @@ {{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }} - {{- $upcoming := where $events ".Params.date" "ge" now }} + {{- $lookback := time.ParseDuration "-6h" }} + {{- $upcoming := where $events ".Params.date" "ge" (time.Now.Add $lookback) }} {{ if $upcoming }}

Neuigkeiten