{{ if not (or (eq .Site.Params.profile false) (eq .Params.profile false)) }} {{/* Display superuser if superuser exists and page authors are not explicitly specified. */}} {{/* Otherwise, display first author if a profile for them exists. */}} {{ $author_urlize := "" }} {{ if and (not .Params.authors) (.Scratch.Get "superuser_username") }} {{ $author_urlize = (.Scratch.Get "superuser_username") }} {{ else }} {{ $first_author := "" }} {{ if .Params.authors }} {{ $first_author = index .Params.authors 0 }} {{ end }} {{ $author_urlize = urlize $first_author }} {{ end }} {{ $person_page_path := (printf "/author/%s" $author_urlize) }} {{ $person_page := site.GetPage $person_page_path }} {{ with $person_page }} {{ $link := printf "/authors/%s" $author_urlize | relURL }} {{ $avatar := ($person_page.Resources.ByType "image").GetMatch "*avatar*" }}
{{end}} {{end}}