{{ $currentTitle := .Title | emojify }} {{ $mainTitle := .Params.mainTitle | emojify }} {{ $titleSeparator := .Site.Params.titleSeparator }} {{ if (eq .Kind "404") }} {{ $currentTitle = .Site.Params.notFound.title | emojify | 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 eq .Kind "term" }} {{ $currentTerm := "" }} {{ if eq .Type "tags" }} {{ $currentTerm = (T "tag") }} {{ else }} {{ $currentTerm = (T "category") }} {{ end }} {{ $currentTitle = printf `%s: "%s"` $currentTerm .Title }} {{ with .Paginator }} {{ if gt .TotalPages 1 }} {{ $mainTitle = printf `%s: "%s", %s %s %s %s` $currentTerm $.Title (T "page") (string .PageNumber) (T "of") (string .TotalPages) }} {{ else }} {{ $mainTitle = printf `%s: "%s"` $currentTerm $.Title }} {{ end }} {{ end }} {{ else if eq .Kind "taxonomy" }} {{ if eq .Type "tags" }} {{ $currentTitle = (T "tags") }} {{ else }} {{ $currentTitle = (T "categories") }} {{ end }} {{ 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 "taxonomy") (eq .Type "tags") (not .Params.description) }} {{ $currentDesc = (T "postsUnderTag" .) }} {{ else if and (ne .Kind "taxonomy") (eq .Type "categories") (not .Params.description) }} {{ $currentDesc = (T "postsUnderCategory" .) }} {{ else if eq .Kind "taxonomy" }} {{ $currentDesc = printf `%s %s.` (T "pageContaining") ($currentTitle | lower) }} {{ else if (eq .Kind "404") }} {{ $currentDesc = .Site.Params.notFound.description | emojify | default .Site.Data.default.notFound.description }} {{ end }} {{ .Scratch.Set "currentTitle" $currentTitle }}