{{ $currentTitle := (.Title | emojify) }} {{ $mainTitle := .Params.mainTitle }} {{ $titleSeparator := .Site.Params.titleSeparator }} {{ if (eq .Kind "404") }} {{ $currentTitle = .Site.Params.notFound.title | default .Site.Data.default.notFound.title }} {{ else if (eq .Kind "section") }} {{ if gt .Paginator.TotalPages 1 }} {{ $mainTitle = printf "%s, %s %s %s %s" .Title (T "page") (string .Paginator.PageNumber) (T "of") (string .Paginator.TotalPages) }} {{ end }} {{ else if (and (ne .Kind "taxonomyTerm") (eq .Type "tags")) }} {{ $currentTitle = printf "%s: \"%s\"" (T "tag") .Title }} {{ if gt .Paginator.TotalPages 1 }} {{ $mainTitle = printf "%s: \"%s\", %s %s %s %s" (T "tag") .Title (T "page") (string .Paginator.PageNumber) (T "of") (string .Paginator.TotalPages) }} {{ else }} {{ $mainTitle = printf "%s: \"%s\"" (T "tag") .Title }} {{ end }} {{ else if (and (eq .Kind "taxonomyTerm") (eq .Type "tags")) }} {{ $currentTitle = (T "tags") }} {{ else if (and (eq .Kind "taxonomyTerm") (eq .Type "categories")) }} {{ $currentTitle = (T "categories") }} {{ else if and (.IsHome) (not .Content) }} {{ $currentTitle = (.Site.Title | emojify) }} {{ end }} {{ $currentDesc := (.Params.Description | emojify) }} {{ if .IsHome }} {{ $currentDesc = (.Site.Params.description | emojify) }} {{ else if and (ne .Kind "taxonomyTerm") (eq .Type "tags") (not .Params.description) }} {{ $currentDesc = (T "posts_under_tag" .) }} {{ else if and (ne .Kind "taxonomyTerm") (eq .Type "categories") (not .Params.description) }} {{ $currentDesc = (T "posts_under_category" .) }} {{ else if eq .Kind "taxonomyTerm" }} {{ $currentDesc = printf "%s %s." (T "page_containing") ($currentTitle | lower) }} {{ else if (eq .Kind "404") }} {{ $currentDesc = .Site.Params.notFound.description | default .Site.Data.default.notFound.description }} {{ end }} {{ .Scratch.Set "currentTitle" $currentTitle }} {{- if and $titleSeparator (not .Params.disableTitleSeparator ) -}} {{ if $mainTitle }} {{- $mainTitle = printf "%s %s %s" $mainTitle $titleSeparator .Site.Title -}} {{ else }} {{- $mainTitle = printf "%s %s %s" $currentTitle $titleSeparator .Site.Title -}} {{ end }} {{- end -}} {{- if $mainTitle -}} {{- $mainTitle -}} {{ else }} {{- $currentTitle -}} {{- end -}} {{ with .Site.Params.author }}{{ end }} {{ with $currentDesc }}{{ end }} {{ if and (.IsPage) (not .Params.sitemapExclude) }} {{ if .Params.canonicalURL }} {{ else if and (ne .Kind "404") (ne .Params.sitemapExclude true) }} {{ end }} {{ else if (eq .Kind "section") }} {{ if .Paginator.HasPrev }} {{ end }} {{ if .Paginator.HasNext }} {{ end }} {{ end }} {{ if or (templates.Exists "partials/custom/head") (templates.Exists "partials/custom/head.html") }} {{ partial "custom/head" . }} {{ end }} {{ with $currentDesc }}{{ end }} {{- if ne .Kind "404" }} {{ end -}} {{ $highRes := .Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes }} {{ $imgPath := .Page.Param "imgPath" }} {{- if .Params.cover }} {{ $file := .Params.cover }} {{ if $imgPath }} {{ $file = path.Join $imgPath $file }} {{ end }} {{- with .Resources.GetMatch $file }} {{ with $.Params.coverAlt }} {{ end }} {{ if and (in $.Site.Params.mainSections $.Section) (not .Params.sitemapExclude) }} {{ $.Scratch.Set "schemaCover" (slice ((.Fill "1280x640").Permalink) ((.Fill "1200x630").Permalink) ((.Resize (index $highRes 0)).Permalink)) }} {{ end }} {{ end -}} {{ else if .Site.Params.cover }} {{ with resources.Get (.Site.Params.cover | default "img/cover.jpg") }} {{ with $.Site.Params.coverAlt }} {{ end }} {{ if and (in $.Site.Params.mainSections $.Section) (not .Params.sitemapExclude) }} {{ $.Scratch.Set "schemaCover" (slice ((.Fill "1280x640").Permalink) ((.Fill "1200x630").Permalink) ((.Resize (index $highRes 0)).Permalink)) }} {{ end }} {{ end }} {{ end -}} {{ if and (in .Site.Params.mainSections .Section) (.IsPage) (not .Params.sitemapExclude) }} {{ if not .Date.IsZero }} {{ end }} {{ with .Params.author }} {{ end }} {{ with or .Page.Params.Social.Centralized .Site.Params.Social.Centralized.twitter }} {{ end}} {{ else }} {{ end -}} {{ with or .Page.Params.Social.Centralized .Site.Params.Social.Centralized.twitter }} {{ end }} {{ with .Site.Params.locale }} {{ end }} {{ if .Site.Config.Privacy.Twitter.EnableDNT }} {{ end }} {{ if .IsTranslated }} {{ range .Translations }} {{ end }} {{ end }} {{ $centralizedOnPage := .Page.Params.Social.Centralized }} {{ $centralizedOnSite := .Site.Params.Social.Centralized }} {{ $decentralizedOnPage := .Page.Params.Social.Decentralized }} {{ $decentralizedOnSite := .Site.Params.Social.Decentralized }} {{ $sameAs := slice }} {{ range .Site.Data.social }} {{ $currentEntry := .entry }} {{ $currentBase := .base }} {{ if not .decentralized }} {{ with (index (or $centralizedOnPage $centralizedOnSite) $currentEntry) }} {{ $sameAs = $sameAs | append (printf "%s%s" $currentBase (index . 0)) }} {{ end }} {{ else }} {{ if (index (or $decentralizedOnPage $decentralizedOnSite) $currentEntry) }} {{ range (index (or $decentralizedOnPage $decentralizedOnSite) $currentEntry) }} {{ $sameAs = $sameAs | append (index . 0) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if and (in .Site.Params.mainSections .Section) (.IsPage) (not .Params.sitemapExclude) }} {{ else }} {{ end }} {{ $main := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | toCSS | minify | resources.Fingerprint "sha512" }} {{ partialCached "font-preload" . }} {{ $lazysizes := resources.Get "libs/lazysizes@5.2.2/lazysizes.min.js" | resources.ExecuteAsTemplate "js/lazysizes.min.js" . | minify | resources.Fingerprint "sha512" }} {{ if or .Params.katex .Site.Params.katex .Params.math .Site.Params.math }} {{ end }} {{ range $sameAs }} {{ end }} {{ with resources.Get "js/prepone.js" | resources.ExecuteAsTemplate .Page . | minify }} {{ end }}