{{ $currentTime := now.Format "15:04" }} {{ $currentDay := now.Format "Monday" }} {{ $isOpen := false }} {{ $holidayInfo := dict }} {{ $isHoliday := false }} {{ range .Site.Data.hours.holidays }} {{ $holidayDate := time .date }} {{ if eq (now.Format "2006-01-02") ($holidayDate.Format "2006-01-02") }} {{ $isHoliday = true }} {{ $holidayInfo = . }} {{ if not .closed }} {{ if and (ge $currentTime .open) (le $currentTime .close) }} {{ $isOpen = true }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if not $isHoliday }} {{ range .Site.Data.hours.regular_hours }} {{ if in .days $currentDay }} {{ if and (ge $currentTime .open) (le $currentTime .close) }} {{ $isOpen = true }} {{ end }} {{ end }} {{ end }} {{ end }} {{ return dict "isOpen" $isOpen "isHoliday" $isHoliday "holidayInfo" $holidayInfo "currentDay" $currentDay "currentTime" $currentTime }}