{{- $author := partial "function-authors-data.html" . -}} {{- $metadata := print "public/" $author.user "/author.json" -}} {{- $alternate := $author.name -}} {{- $width := "" -}} {{- $height := "" -}} {{- $source := "" -}} {{- $sourceset := "" -}} {{- 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.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} {{- $sourceset = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-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 not (path.Ext $author.picture.profile) -}} {{- $source = "/data/media/404.png" -}} {{- $sourceset = "" -}} {{- end -}} {{- with $sourceset -}} {{- end -}} {{ $alternate }} {{- /* This comment removes trailing newlines and white spaces. */ -}}