{{ define "main" }} {{ range .Params.topics }} {{ partial "modal" . }} {{ end }} {{ if .Params.pretext.enable }} {{ partial "modal" (dict "title" .Title "content" .Params.pretext.content) }} {{ end }}
{{ if or .Params.cantorpreisträger (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) }}
{{ range where (where .Site.RegularPages "Title" .Params.Title ) "Type" "=" "cantorpreis" }} {{ end }} {{ range where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) }}

{{ .Title }}

{{ range (resources.Get "charts/abiturdurchschnitte.json" | transform.Unmarshal).abiturdurchschnitte }} {{ if eq (string .jahr) $.Title }}Abiturdurchschnitt: {{ .schnitt }}{{ end }} {{ end }}
{{ end }}
{{ end }}
{{ .Title }}
{{ $topics := slice }} {{ range .Params.topics }} {{ $topics = $topics | append (dict "titleLength" (len .title) "topic" .) }} {{ end }} {{ range $id, $topic := sort $topics "titleLength" "desc" }}
{{ $topic.topic.title | safeHTML }}
{{ end }}
{{ end }}