{{- if eq .Kind "taxonomyTerm" }} {{- range $key, $value := .Data.Terms.ByCount }} {{- $.Scratch.Add "most_used" (slice $value.Name) }} {{- end }} {{- $description := printf "A full overview of all pages with %s, ordered by %s, such as: %s" .Data.Plural .Data.Singular ( delimit ( $.Scratch.Get "most_used" ) ", " ", and " ) | truncate 180 }} {{- $.Scratch.Set "Description" $description }} {{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }} {{- $.Scratch.Set "Title" $title }} {{- else if eq .Kind "taxonomy" }} {{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }} {{- $.Scratch.Set "Description" $description }} {{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }} {{- $.Scratch.Set "Title" $title }} {{- end }}
{{- with ($.Scratch.Get "Title") | default .Title | default .Site.Title }}