diff --git a/content/events-archive/_index.en.md b/content/events-archive/_index.en.md new file mode 100644 index 0000000..68824e2 --- /dev/null +++ b/content/events-archive/_index.en.md @@ -0,0 +1,6 @@ +--- +title: Archive +layout: events-archive +meta: Vergangene Veranstaltungen +img_header: /okf/team-social-og.png +--- diff --git a/content/events-archive/_index.md b/content/events-archive/_index.md new file mode 100644 index 0000000..68824e2 --- /dev/null +++ b/content/events-archive/_index.md @@ -0,0 +1,6 @@ +--- +title: Archive +layout: events-archive +meta: Vergangene Veranstaltungen +img_header: /okf/team-social-og.png +--- diff --git a/content/events/_index.md b/content/events/_index.md index 0b7e147..45bf98b 100644 --- a/content/events/_index.md +++ b/content/events/_index.md @@ -5,6 +5,3 @@ layout: events meta: openSenseLab Termine und Veranstaltungen img_header: /files/logos/openSenseLab-Logo.svg --- - - -Test diff --git a/layouts/_default/events-archive.html b/layouts/_default/events-archive.html new file mode 100644 index 0000000..4f276ef --- /dev/null +++ b/layouts/_default/events-archive.html @@ -0,0 +1,160 @@ +{{ define "title" }} +{{ .Title }} - {{ .Site.Title }} +{{ end }} {{ define "head" }} {{ range .AlternativeOutputFormats -}} + +{{ end -}} + + + +{{ with .Params.img_header }} + +{{ end }} {{ with .Params.meta }} + + +{{ end }} {{ end }} {{ define "main" }} +
+
+
+

+ {{ 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 }} +

    + +
    +

    + {{ 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 }} +
    +
    + + {{ with $event.Params.location }} +

    + @ {{ . }} +

    + {{ end }} + +

    + {{ with $event.Params.summary }}{{ . | markdownify }}{{ else + }}{{ $event.Summary }}{{ end }} +

    + +
    +
    +
  • + {{ end }} {{ if eq (len $archive) 0 }} +
  • +
    + {{ i18n "no_archived_events" | default "No archived events yet." + }} +
    +
  • + {{ end }} +
+
+
+
+
+{{ end }}