Toevoegen van uitgelicht evenement

This commit is contained in:
Michael Boelen 2023-06-15 19:42:21 +02:00
parent 7c8950f396
commit b5fa24bf99
2 changed files with 73 additions and 1 deletions

View file

@ -1,7 +1,30 @@
{{ define "main" }}
{{ $.Scratch.Set "highlighted_events" slice }}
{{ range .Pages }}
{{ if isset .Params "event_start" }}
{{ $event_start := .Params.event_start | time }}
{{ if le now $event_start }}
{{ $.Scratch.Add "highlighted_events" . }}
{{ end }}
{{ end }}
{{ end }}
{{ if (gt ($.Scratch.Get "highlighted_events" | len) 0) }}
<h2>Aankomende evenementen</h2>
<div class="three-column-grid">
{{ range $.Scratch.Get "highlighted_events" }}
{{ partial "show-highlighted-event.html" . }}
{{ end }}
</div>
{{ end }}
<h2>Overzicht</h2>
<section>
<ul class="list">
{{ range .Pages }}
{{ range .Pages.ByDate }}
<li>
<a class="link" href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
<hr class="hr-list">