Theme: Keep current event for 6 hours after start date #53

Merged
jtbx merged 1 commit from feature/event-lookbehind into main 2024-03-07 20:14:48 +01:00

View file

@ -5,7 +5,8 @@
</div>
{{- $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 }}
<div class="announcements">
<h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></h2>