{{- $assetBusting := partialCached "assetbusting.hugo" . }} {{- $faviconMatch := false }} {{- $svg := dict "ext" "svg" "type" "type=\"image/svg+xml\"" }} {{- $png := dict "ext" "png" "type" "type=\"image/png\"" }} {{- $ico := dict "ext" "ico" "type" "type=\"image/x-icon\" sizes=\"any\"" }} {{- $faviconTypes := slice $svg $png $ico }} {{- $faviconNames := slice "favicon" "logo" }} {{- range $faviconNames }} {{- $faviconName := . }} {{- range $faviconTypes }} {{- if fileExists (printf "/static/images/%s.%s" $faviconName .ext) }} {{- $faviconMatch = true }} {{- end }} {{- if (fileExists (printf "/static/images/%s-light.%s" $faviconName .ext)) }} {{- $faviconMatch = true }} {{- end }} {{- if (fileExists (printf "/static/images/%s-dark.%s" $faviconName .ext)) }} {{- $faviconMatch = true }} {{- end }} {{- end }} {{- if $faviconMatch }} {{- break }} {{- end }} {{- end }}