{{- $params := .params -}} {{- $contactsExist := or $params.contacts $params.roles -}} {{- range .chapters -}} {{- $content := index $params . -}} {{- $chapterExists := $content -}} {{ if eq "contacts" . }} {{- $chapterExists = $contactsExist -}} {{ end }} {{- if $chapterExists }}
{{ $title := i18n (printf "programs._%s" .) -}}

{{ $title }}

{{ if eq . "contacts" }} {{- partial "programs/content.html" $content -}} {{- partial "programs/roles.html" $params.roles -}} {{ else if eq . "teachers" }} {{- partial "programs/teachers.html" (dict "title" $title "teachers" $params.teachers "descriptions" $params.teachers_description ) -}} {{ else }} {{- partial "programs/content.html" $content -}} {{ end }}
{{ end -}} {{- end -}}