{{ .Scratch.Set "title" .Site.Title }} {{ .Scratch.Set "publisherIcon" .Site.Params.favicon }} {{ if .Site.Params.publisherIcon }} {{ .Scratch.Set "publisherIcon" .Site.Params.publisher_icon }} {{ end }} {{ if eq .Kind "home" }} {{ .Scratch.Set "title" $.Site.Params.brand }} {{ .Scratch.Set "description" .Site.Params.Description }} {{ else }} {{ .Scratch.Set "description" .Description }} {{ end }} {{ if .IsSection }} {{ .Scratch.Set "title" ($.Site.Params.brand) }} {{ .Scratch.Add "title" " - " }} {{ .Scratch.Add "title" .LinkTitle }} {{ end }} {{ if .IsPage }} {{ .Scratch.Set "title" ($.Site.Params.brand) }} {{ .Scratch.Add "title" " - " }} {{ .Scratch.Add "title" .LinkTitle }} {{ end }} {{ "" | safeHTML }} {{ $image_path := .Params.image | default .Site.Params.og_image -}} {{ with $image_path }} {{ $image_path_local := printf "assets/%s" $image_path -}} {{ $image_ext := trim (path.Ext $image_path | lower) "." -}} {{ if fileExists $image_path_local -}} {{ $image_path:= resources.Get $image_path}} {{/* If not SVG, read image aspect ratio and define Twitter Card and Open Graph width and height */ -}} {{ if ne $image_ext "svg" -}} {{ with (imageConfig $image_path_local) -}} {{ if (and (gt .Width 144) (gt .Height 144)) -}} {{ end -}} {{ end -}} {{ end -}} {{ end -}} {{ end -}} {{ .Scratch.Get "title" }} {{ range .AlternativeOutputFormats -}} {{ printf `` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }} {{ end -}} {{if (or (ne .Site.Params.twitter_url nil) (ne .Site.Params.x_url nil))}} {{ $twitter_user := index (split (default .Site.Params.twitter_url .Site.Params.x_url) "/") 3 }} {{end}} {{ if and (eq .Section "posts") (.Page.IsNode) }} {{ $paginator := .Paginate (where .Pages "Type" "posts") }} {{ if $paginator }} {{ if $paginator.HasPrev }} {{end }} {{ if $paginator.HasNext }} {{end }} {{end }} {{ with (or (.Params.Author) (.Site.Language.Params.Author.Name)) }} {{ end }} {{ with.Params.category }} {{ end }} {{ end }} {{ hugo.Generator }}