{{ $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 }}