blog/layouts/partials/head.html

73 lines
2.4 KiB
HTML

<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer-when-downgrade">
<meta name="theme-name" content="Anubis2">
{{ partial "title.html" . }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
<meta name="author" content="{{ with .Params.author }}{{ . }}{{ else }}{{ with site.Params.author }}{{ . }}{{ end }}{{ end -}}">
<meta name="copyright" content="{{ with site.Params.copyright }}{{ . }}{{ else }}{{ with site.Params.author }}{{ . }}{{ end }}{{ end -}}">
{{ with .Keywords }}
<meta name="keywords" content="{{ range $i, $e := . }}{{ if $i }},{{ end }}{{ $e }}{{ end }}">
{{ end }}
{{ if and (.IsPage) (eq .Params.private true)}}
<meta name="robots" content="noindex" />
{{ end }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink site.Title | safeHTML }}
{{ end -}}
{{ partial "head/favicons.html" . }}
{{ $params := partial "params-helper.html" . }}
{{ if or (eq $params.enableColorThemeSwitcher true) (eq $params.colorTheme "auto") }}
<style>
body {
visibility: hidden;
opacity: 0;
}
</style>
<noscript>
<style>
body {
visibility: visible;
opacity: 1;
}
</style>
</noscript>
{{ end }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/light.css") }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/dark.css") }}
{{ partial "features/custom-css.html" . }}
{{ partial "features/custom-js.html" . }}
{{ if $params.enableCopyCodeButton }}
{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/copy-code.js") }}
{{ end }}
{{ range $params.customJS -}}
{{ partial "resource.html" (dict "context" $ "type" "js" "filename" . ) }}
{{- end }}
{{- if isset .Params "canonical" -}}
<link rel="canonical" href="{{ .Params.canonical }}" />
{{- else -}}
<link rel="canonical" href="{{ .Permalink }}" />
{{- end }}
{{ partial "head-extra.html" . }}
{{ if hugo.IsProduction }}
{{ if isset $params.services "umami" }}
{{ partial "analytics/umami_analytics.html" . }}
{{ end }}
{{ end }}