Fix 'schedule' shortcode when rooms do not have events on all days

This commit is contained in:
Luca 2022-08-29 00:32:50 +02:00
parent 2de66d7789
commit 2463c21096
1 changed files with 6 additions and 4 deletions

View File

@ -9,10 +9,12 @@
{{ $rooms := dict }}
{{ range $day := .conference.days }}
{{ range $room := $data.schedule.conference.rooms }}
{{ if index $rooms $room.name }}
{{ $rooms = merge $rooms (dict $room.name ((index $rooms $room.name) | append (index $day.rooms .name))) }}
{{ else }}
{{ $rooms = merge $rooms (dict $room.name (index $day.rooms .name)) }}
{{ with index $day.rooms $room.name }}
{{ if index $rooms $room.name }}
{{ $rooms = merge $rooms (dict $room.name ((index $rooms $room.name) | append .)) }}
{{ else }}
{{ $rooms = merge $rooms (dict $room.name .) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}