+ {{ if .Params.blurb }}{{ .Params.blurb }}{{ else }}{{ .Title }}{{ end }} +
+ +-
+ {{/* Build a list of archived/past events */}} {{ $archive := slice }}
+ {{ $today := now.Format "2006-01-02" }} {{ $events := where
+ site.RegularPages "Section" "events" }} {{ range $events }} {{ $p := .
+ }} {{/* Flags and dates from front matter */}} {{ $flagArchive := or
+ ($p.Params.archive | default false) false }} {{ $singleDate :=
+ $p.Params.eventdate | default "" }} {{ $startDate :=
+ $p.Params.eventdatestart | default "" }} {{ $endDate :=
+ $p.Params.eventdateend | default "" }} {{/* Normalize to a start and
+ end time */}} {{ if $startDate }} {{ $start := time $startDate }} {{
+ $end := cond (ne $endDate "") (time $endDate) $start }} {{/* archive:
+ include if explicitly archived OR event ended before today */}} {{ if
+ or $flagArchive (lt ($end.Format "2006-01-02") $today) }} {{ $archive
+ = $archive | append (dict "page" $p "start" $start "end" $end) }} {{
+ end }} {{ else if $singleDate }} {{ $date := time $singleDate }} {{ if
+ or $flagArchive (lt ($date.Format "2006-01-02") $today) }} {{ $archive
+ = $archive | append (dict "page" $p "start" $date "end" $date) }} {{
+ end }} {{ else }} {{/* If no dates, include only when explicitly
+ flagged archived */}} {{ if $flagArchive }} {{ $archive = $archive |
+ append (dict "page" $p "start" (time $p.Date) "end" (time $p.Date)) }}
+ {{ end }} {{ end }} {{ end }} {{/* Sort most recent first
+ (descending), with year headers */}} {{ $currentYear := "" }} {{ range
+ sort $archive "start" "desc" }} {{ $event := .page }} {{ $start :=
+ .start }} {{ $end := .end }} {{ $year := $start | time.Format "2006"
+ }} {{ if ne $year $currentYear }} {{ $currentYear = $year }}
+
-
+
{{ $year }}
+
+ {{ end }}
+
+ -
+ ++++
+ {{ $event.Title }} +
+ +++ + {{ with $event.Params.location }} ++ {{ if eq $start $end }} {{ $start | time.Format ":date_long" + }} {{ else }} {{ printf "%s – %s" ($start | time.Format + ":date_long") ($end | time.Format ":date_long") }} {{ end }} +
+ ++ {{ range $event.Params.tags }} + + {{ . }} + + {{ end }} +++ @ {{ . }} +
+ {{ end }} + ++ {{ with $event.Params.summary }}{{ . | markdownify }}{{ else + }}{{ $event.Summary }}{{ end }} +
++ + {{ i18n "details" | default "Details" }} + + {{ with $event.Params.link }} + + {{ i18n "external_link" | default "Externe Seite" }} + + {{ end }} ++
+ {{ end }} {{ if eq (len $archive) 0 }}
+ -
+ + {{ i18n "no_archived_events" | default "No archived events yet." + }} ++
+ {{ end }}
+