{{- $author := .Section -}} {{- $authors := partial "function-authors-data.html" . -}} {{- $metadata := print "public/" $author "/author.json" -}} {{- $width := "" -}} {{- $height := "" -}} {{- $source := "" -}} {{- $sourceset := "" -}} {{- $alternate := $author -}} {{- with .Params.feed.favicon -}} {{- $alternate = $.Params.feed.name -}} {{- $width = "64" -}} {{- $height = "64" -}} {{- $source = print "/" (partial "function-paths.html").media "/favicon." ($.Params.feed.source | anchorize) ".png" -}} {{- if not (fileExists (print "public/" $source)) -}} {{- $source = $.Params.feed.favicon -}} {{- end -}} {{- $sourceset = "" -}} {{- else -}} {{- $source = print "/" (partial "function-paths.html").media "/" $author "/" $author "-profile" (path.Ext $authors.picture.profile) -}} {{- $sourceset = print "/" (partial "function-paths.html").media "/" $author "/" $author "-profile.webp" -}} {{- with $metadata := resources.Get $metadata -}} {{- with $content := $metadata.Content -}} {{- $metadata = $content | transform.Unmarshal -}} {{- $width = $metadata.picture.profileWidth -}} {{- $height = $metadata.picture.profileHeight -}} {{- end -}} {{- else -}} {{- $source = "/data/media/404.png" -}} {{- $sourceset = "" -}} {{- end -}} {{- end -}} {{- if (path.Ext $authors.picture.profile) -}} {{- with $sourceset -}} {{- end -}} {{ $alternate }} {{- else -}} {{ delimit (first 1 (split $author "")) "" | strings.Title }} {{- end -}} {{- /* This comment removes trailing newlines and white spaces. */ -}}