{{- $noindex := .Params.noindex | default false -}} {{ if and (hugo.IsProduction) (not $noindex) -}} {{ else -}} {{ end -}} {{ partialCached "favicons.html" . -}} {{- if .IsHome -}} {{ .Site.Title -}} {{ else -}} {{ with .Title }}{{ . }} – {{ end -}} {{ .Site.Title -}} {{ end -}} {{- with .Params.canonical -}} {{- else -}} {{- end -}} {{- partial "opengraph.html" . -}} {{- partial "schema.html" . -}} {{- partial "twitter_cards.html" . -}} {{- $mainCss := resources.Get "css/compiled/main.css" -}} {{- $customCss := resources.Get "css/custom.css" -}} {{- $variablesCss := resources.Get "css/variables.css" | resources.ExecuteAsTemplate "css/variables.css" . -}} {{- /* Production build */ -}} {{- if hugo.IsProduction }} {{- $styles := slice $variablesCss $mainCss $customCss | resources.Concat "css/compiled/main.css" | minify | fingerprint }} {{- /* Theme development mode (non-production + theme environment) */ -}} {{- else if eq hugo.Environment "theme" }} {{- $devStyles := resources.Get "css/styles.css" | postCSS (dict "inlineImports" true) }} {{- /* User local development */ -}} {{- else }} {{- $styles := resources.Get "css/compiled/main.css" -}} {{- end }} {{- if and hugo.IsProduction .Site.Config.Services.GoogleAnalytics.ID }} {{ partial "google-analytics.html" . -}} {{- end }} {{ $noop := .WordCount -}} {{ if .Page.Store.Get "hasMath" -}} {{ $katexBaseUrl := "https://cdn.jsdelivr.net/npm/katex@latest/dist" }} {{ $katexCssUrl := printf "%s/katex%s.css" $katexBaseUrl (cond hugo.IsProduction ".min" "") -}} {{ $katexFontPattern := "url(fonts/" }} {{ $katexFontSubstituted := printf "url(%s/fonts/" $katexBaseUrl }} {{ with try (resources.GetRemote $katexCssUrl) -}} {{ with .Err -}} {{ errorf "Could not retrieve KaTeX css file from %s. Reason: %s." $katexCssUrl . -}} {{ else with .Value -}} {{ $katexCssContent := strings.Replace .Content $katexFontPattern $katexFontSubstituted }} {{ with resources.FromString (printf "css/katex%s.css" (cond hugo.IsProduction ".min" "")) $katexCssContent -}} {{ $cssHash := . | fingerprint "sha512" -}} {{ end -}} {{ end -}} {{ end -}} {{ end -}} {{ partial "custom/head-end.html" . -}}