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
Showing only changes of commit 7e29bd5369 - Show all commits

View file

@ -5,7 +5,8 @@
</div> </div>
{{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }} {{- $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 }} {{ if $upcoming }}
<div class="announcements"> <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> <h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></h2>