mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 09:46:11 +01:00
12 lines
No EOL
641 B
Text
12 lines
No EOL
641 B
Text
{{- $allEvents := where site.RegularPages "Section" "calendar" -}}
|
|
{{- $upcomingEvents := slice }}
|
|
{{- range $eventPage := $allEvents -}}
|
|
{{ range $eventPage.Params.timings }}
|
|
{{ $event := dict "Title" $eventPage.Title "Page" $eventPage.Page "Date" (time.AsTime .starts) "Duration" (partial "iso8601.duration" .duration) }}
|
|
{{ if $event.Date.Before time.Now }}{{ continue }}{{ end }}
|
|
{{ if eq .attending false }}{{ continue }}{{ end }}
|
|
{{ $upcomingEvents = sort ($upcomingEvents | append $event) "Date" "asc" }}
|
|
{{ break }}{{/* Only show the first on the list */}}
|
|
{{ end }}
|
|
{{- end -}}
|
|
{{- return $upcomingEvents -}} |