diff --git a/data/days.yml b/data/days.yml new file mode 100644 index 0000000..ffb9f0b --- /dev/null +++ b/data/days.yml @@ -0,0 +1,7 @@ +Mon: Montag +Tue: Dienstag +Wed: Mittwoch +Thu: Donnerstag +Fri: Freitag +Sat: Samstag +Sun: Sonntag diff --git a/themes/tsc_vfl/layouts/shortcodes/tsc/calendar/table.html b/themes/tsc_vfl/layouts/shortcodes/tsc/calendar/table.html new file mode 100644 index 0000000..05367e1 --- /dev/null +++ b/themes/tsc_vfl/layouts/shortcodes/tsc/calendar/table.html @@ -0,0 +1,52 @@ +{{ $calendars := .Site.Data.schedule.calendars -}} +{{- $list := slice -}} +{{- range $room, $roomData := $calendars -}} + {{- if ($roomData.ignore | default false) -}}{{ continue }}{{- end -}} + {{- $roomName := $roomData.name | default $room -}} + {{/* warnf "%s " $room */}} + {{- range $roomData.schedule -}} + {{- $addData := dict "room" $roomName "weight" 0 -}} + {{- $addData = merge $addData . -}} + {{/* warnf "%#v" $addData */}} + {{- $list = $list | append $addData -}} + {{- end -}} +{{- end -}} +{{- $cat := .Get "category" -}} +{{- $showAge := .Get "showAge" | default false -}} +{{- $list = sort $list "start" -}} +{{- $list = sort $list "title" -}} +{{- $list = sort $list "weight" -}} +{{/* warnf "%#v" $list */}} +
Gruppe | + {{ if $showAge }}Jahrgang | {{ end }} +Tag | +Zeit | +Ort | +
---|---|---|---|---|
+ {{ .title }}{{ with .subtitle }} - {{ . }}{{ end }} + | + {{ if $showAge }}{{ .age }} | {{ end }} +{{ index site.Data.days .day }} | ++ {{- $startTimeStr := printf "2025-01-02T%s:00" .start -}} + {{- $startTime := time.AsTime $startTimeStr -}} + {{- $duration := time.Duration "minute" .duration -}} + {{- $endTime := $startTime.Add $duration}} + {{/* warnf "Start %s, duration %s, %s" $startTime $duration $endTime */}} + {{- $startTime.Format "15:04"}} - {{ $endTime.Format "15:04" }} + | +{{ .room }} | +