{{ 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) }} {{ $researcher := site.GetPage (printf "/researchers/%s" $slug) }} {{ $posts := where $author.Pages "Section" "posts" }} {{ $publications := where $researcher.Pages "Section" "publications" }} {{ $papers := where $researcher.Pages "Section" "papers" }} {{ partial "persons/hero-single.html" . }}
{{ partial "toc/container.html" (dict "toc" "toc/default.html" "context" . ) }}
{{ with .Params.image }} {{ $image_id := "" }} {{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}} {{ if eq (printf "%T" .) "string" }} {{ $image_id = . }} {{ else }} {{ $image_id = index . "id" }} {{ end }} {{- with partial "GetMedia" $image_id -}} {{- end -}} {{ end }}
{{ if .Params.biography }}
{{ partial "persons/summary.html" (dict "context" . ) }} {{ if (partial "GetTextFromHTML" .Params.biography) }}
{{ partial "PrepareHTML" .Params.biography }}
{{ end }}
{{ end }} {{ if $programsForAdministrator }}
{{ range $programsForAdministrator }} {{ $program := . }} {{ range .Params.roles }} {{ $role := .title }} {{ if in .persons $slug }}

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

{{ end }} {{ end }} {{ end }}
{{ end }}
{{ partial "commons/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 "researcher" $researcher) }} {{ end }} {{ if $posts }} {{ partial "persons/posts.html" (dict "posts" $posts "author" $author) }} {{ end }} {{ if $papers }} {{ partial "persons/papers.html" (dict "papers" $papers "researcher" $researcher) }} {{ end }}
{{ if site.Params.persons.single.backlinks }} {{ partial "contents/backlinks.html" . }} {{ end }}
{{ end }}