diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..d3c8456 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,138 @@ + + + + + + +{{ partial "title.html" . }} + + +{{ with .Keywords }} + +{{ end }} + +{{ if and (.IsPage) (eq .Params.hidden true)}} + +{{ end }} + +{{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} +{{ end -}} + +{{ partial "favicons.html" . }} + +{{ $colorTheme := "light" }} +{{ $colorThemeSwitcher := true }} + +{{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ $colorTheme = site.Params.colortheme | lower }} +{{ end }} + +{{ if isset site.Params "colorthemeswitcher" }} + {{ $colorThemeSwitcher = site.Params.colorthemeswitcher }} +{{ else }} + {{ $colorThemeSwitcher = true }} +{{ end }} + +{{ if or (eq $colorThemeSwitcher true) (eq $colorTheme "auto") }} + + + +{{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") }} + + +{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }} +{{ range site.Params.customCSS }} + {{ $r := "" }} + {{ with resources.Get . }} + {{ $r = . }} + {{ else }} + {{ errorf "error: You defined customCSS, but %s was not found, please check your config." . }} + {{ end }} + + {{ if $r}} + {{ with $r | toCSS $opts | minify | fingerprint }} + + {{ end }} + {{ end }} +{{ end }} + +{{ if site.Params.isso.enabled }} {{/* TODO: maybe we can remove it */}} + +{{ end }} + + +{{ if .Site.Params.copyCodeButton | default true }} + {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/copy-code.js") }} +{{ end }} + +{{ range .Site.Params.customJS -}} + {{ partial "resource.html" (dict "context" $ "type" "js" "filename" . ) }} +{{- end }} + +{{ if isset .Site.Params "webmentions" }} + {{ if isset .Site.Params.webmentions "login" }} + + {{ if eq .Site.Params.webmentions.pingback true }} + + {{ end }} + {{ end }} + {{ if isset .Site.Params.webmentions "url" }} + + {{ end }} +{{ end }} + + + + +{{ if (.Site.Params.GoogleAnalytics.enabled) }} + {{ partial "google_analytics.html" . }} +{{ end }} + +{{ if (.Site.Params.UmamiAnalytics.enabled ) }} + {{ partial "umami_analytics.html" . }} +{{ end }} + +{{ partial "head-extra.html" . }} + + +