From 2463c2109681b7b512b5f9bf40749231f7276e16 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 29 Aug 2022 00:32:50 +0200 Subject: [PATCH] Fix 'schedule' shortcode when rooms do not have events on all days --- layouts/shortcodes/schedule.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/layouts/shortcodes/schedule.html b/layouts/shortcodes/schedule.html index a1539c2..53f913e 100644 --- a/layouts/shortcodes/schedule.html +++ b/layouts/shortcodes/schedule.html @@ -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 }}