diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2e9105e4..3ca809de 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -37,6 +37,59 @@ }} {{ end }} + {{/* Me */}} + {{ with .Site.Params.Author.name }} + + {{ end }} + {{ with .Site.Params.Author.links }} + {{ range $links := . }} + {{ range $name, $url := $links }} + {{ if not (strings.HasPrefix $url "mailto:") }} + + {{ end }} + {{ end }} + {{ end }} + {{ end }} + + {{/* Social */}} + {{ template "_internal/opengraph.html" . }} + {{ template "_internal/twitter_cards.html" . }} + + {{/* Main page always uses this; fallback elsewhere if no feature image */}} + {{/* See https://gohugo.io/templates/embedded/#open-graph */}} + {{ $images := .Resources.ByType "image" }} + {{ $socialImage := $images.GetMatch "*feature*" }} + {{ if not $socialImage }} + {{ with .Site.Params.defaultSocialImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $socialImage = resources.GetRemote . }} + {{ else }} + {{ $socialImage = resources.Get . }} + {{ end }} + {{ end }} + {{ end }} + {{ with $socialImage }} + + + {{ end }} + + {{/* Site Verification */}} + {{ with .Site.Params.verification.google }} + + {{ end }} + {{ with .Site.Params.verification.bing }} + + {{ end }} + {{ with .Site.Params.verification.pinterest }} + + {{ end }} + {{ with .Site.Params.verification.yandex }} + + {{ end }} + {{ with .Site.Params.verification.fediverse }} + + {{ end }} + {{ $alg := .Site.Params.fingerprintAlgorithm | default "sha512" }} {{/* CSS */}} @@ -112,6 +165,9 @@ data-copied="{{ i18n "code.copied" }}"> {{ end }} + {{/* Conditional loaded resources */}} + {{ partial "vendor.html" . }} + {{/* Icons */}} {{ if templates.Exists "partials/favicons.html" }} {{ partialCached "favicons.html" .Site }} @@ -122,67 +178,9 @@ {{ end }} - {{/* Site Verification */}} - {{ with .Site.Params.verification.google }} - - {{ end }} - {{ with .Site.Params.verification.bing }} - - {{ end }} - {{ with .Site.Params.verification.pinterest }} - - {{ end }} - {{ with .Site.Params.verification.yandex }} - - {{ end }} - {{ with .Site.Params.verification.fediverse }} - - {{ end }} - - {{/* Social */}} - {{ template "_internal/opengraph.html" . }} - {{ template "_internal/twitter_cards.html" . }} - - {{ /* Main page always uses this; fallback elsewhere if no feature image */ }} - {{ /* See https://gohugo.io/templates/embedded/#open-graph */ }} - {{ $images := .Resources.ByType "image" }} - {{ $socialImage := $images.GetMatch "*feature*" }} - - {{ if not $socialImage }} - {{ with .Site.Params.defaultSocialImage }} - {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} - {{ $socialImage = resources.GetRemote . }} - {{ else }} - {{ $socialImage = resources.Get . }} - {{ end }} - {{ end }} - {{ end }} - - {{ with $socialImage }} - - - {{ end }} - {{/* Schema */}} {{ partial "schema.html" . }} - {{/* Me */}} - {{ with .Site.Params.Author.name }} - - {{ end }} - {{ with .Site.Params.Author.links }} - {{ range $links := . }} - {{ range $name, $url := $links }} - {{ if not (strings.HasPrefix $url "mailto:") }} - - {{ end }} - {{ end }} - {{ end }} - {{ end }} - - {{/* Vendor */}} - {{ partial "vendor.html" . }} - {{/* Analytics */}} {{ partial "analytics/main.html" .Site }}