mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
refactor(head): move meta to the front
This commit is contained in:
@@ -37,6 +37,59 @@
|
|||||||
}}
|
}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* Me */}}
|
||||||
|
{{ with .Site.Params.Author.name }}
|
||||||
|
<meta name="author" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Site.Params.Author.links }}
|
||||||
|
{{ range $links := . }}
|
||||||
|
{{ range $name, $url := $links }}
|
||||||
|
{{ if not (strings.HasPrefix $url "mailto:") }}
|
||||||
|
<link href="{{ $url }}" rel="me">
|
||||||
|
{{ 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 }}
|
||||||
|
<meta name="twitter:image" content="{{ .RelPermalink | absURL }}">
|
||||||
|
<meta property="og:image" content="{{ .RelPermalink | absURL }}">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* Site Verification */}}
|
||||||
|
{{ with .Site.Params.verification.google }}
|
||||||
|
<meta name="google-site-verification" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Site.Params.verification.bing }}
|
||||||
|
<meta name="msvalidate.01" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Site.Params.verification.pinterest }}
|
||||||
|
<meta name="p:domain_verify" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Site.Params.verification.yandex }}
|
||||||
|
<meta name="yandex-verification" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Site.Params.verification.fediverse }}
|
||||||
|
<meta name="fediverse:creator" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $alg := .Site.Params.fingerprintAlgorithm | default "sha512" }}
|
{{ $alg := .Site.Params.fingerprintAlgorithm | default "sha512" }}
|
||||||
|
|
||||||
{{/* CSS */}}
|
{{/* CSS */}}
|
||||||
@@ -112,6 +165,9 @@
|
|||||||
data-copied="{{ i18n "code.copied" }}"></script>
|
data-copied="{{ i18n "code.copied" }}"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* Conditional loaded resources */}}
|
||||||
|
{{ partial "vendor.html" . }}
|
||||||
|
|
||||||
{{/* Icons */}}
|
{{/* Icons */}}
|
||||||
{{ if templates.Exists "partials/favicons.html" }}
|
{{ if templates.Exists "partials/favicons.html" }}
|
||||||
{{ partialCached "favicons.html" .Site }}
|
{{ partialCached "favicons.html" .Site }}
|
||||||
@@ -122,67 +178,9 @@
|
|||||||
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
|
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* Site Verification */}}
|
|
||||||
{{ with .Site.Params.verification.google }}
|
|
||||||
<meta name="google-site-verification" content="{{ . }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with .Site.Params.verification.bing }}
|
|
||||||
<meta name="msvalidate.01" content="{{ . }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with .Site.Params.verification.pinterest }}
|
|
||||||
<meta name="p:domain_verify" content="{{ . }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with .Site.Params.verification.yandex }}
|
|
||||||
<meta name="yandex-verification" content="{{ . }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with .Site.Params.verification.fediverse }}
|
|
||||||
<meta name="fediverse:creator" content="{{ . }}">
|
|
||||||
{{ 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 }}
|
|
||||||
<meta name="twitter:image" content="{{ .RelPermalink | absURL }}">
|
|
||||||
<meta property="og:image" content="{{ .RelPermalink | absURL }}">
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{/* Schema */}}
|
{{/* Schema */}}
|
||||||
{{ partial "schema.html" . }}
|
{{ partial "schema.html" . }}
|
||||||
|
|
||||||
{{/* Me */}}
|
|
||||||
{{ with .Site.Params.Author.name }}
|
|
||||||
<meta name="author" content="{{ . }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with .Site.Params.Author.links }}
|
|
||||||
{{ range $links := . }}
|
|
||||||
{{ range $name, $url := $links }}
|
|
||||||
{{ if not (strings.HasPrefix $url "mailto:") }}
|
|
||||||
<link href="{{ $url }}" rel="me">
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{/* Vendor */}}
|
|
||||||
{{ partial "vendor.html" . }}
|
|
||||||
|
|
||||||
{{/* Analytics */}}
|
{{/* Analytics */}}
|
||||||
{{ partial "analytics/main.html" .Site }}
|
{{ partial "analytics/main.html" .Site }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user