{{ define "main" }} {{- $slug := .Slug -}} {{- $programsForTeacher := slice -}} {{ if isset site.Taxonomies "teachers" -}} {{ $programsForTeacher = index site.Taxonomies.teachers $slug}} {{- end }} {{- $programsForAdministrator := slice -}} {{ if isset site.Taxonomies "administrators" -}} {{ $programsForAdministrator = index site.Taxonomies.administrators $slug}} {{- end }} {{ $author := site.GetPage (printf "/authors/%s" $slug) }} {{ $posts := where $author.Pages "Section" "posts" }} {{ $publications := where $author.Pages "Section" "publications" }} {{ $papers := where $author.Pages "Section" "papers" }} {{ partial "persons/hero-single.html" . }}
{{ partial "toc/container.html" (dict "toc" "toc/default.html" "context" . ) }}
{{- if .Params.image -}} {{- $image := partial "GetMedia" .Params.image -}} {{- if $image -}} {{- end -}} {{- end -}}
{{ partial "persons/summary.html" (dict "context" . ) }} {{ if (partial "GetTextFromHTML" .Content) }}
{{ partial "PrepareHTML" .Content }}
{{ end }}
{{ range $programsForAdministrator }} {{ $program := . }}
{{ range .Params.roles }} {{ $role := .title }} {{ if in .persons $slug }}

{{ safeHTML $role }}
{{ safeHTML $program.Title }}

{{ end }} {{ end }}
{{ end }}
{{ partial "persons/contact-details.html" . }}
{{ partial "contents/list.html" . }}
{{ if $programsForTeacher }} {{ partial "persons/programs.html" (dict "programs" $programsForTeacher "slug" $slug) }} {{ end }} {{ if $publications }} {{ partial "persons/publications.html" (dict "publications" $publications) }} {{ end }} {{ if $posts }} {{ partial "persons/posts.html" (dict "posts" $posts) }} {{ end }} {{ if $papers }} {{ partial "persons/papers.html" (dict "papers" $papers "slug" $slug) }} {{ end }}
{{ end }}