github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/pageHelper/title.hugo (about) 1 {{- $title := "" }} 2 {{- with .page }} 3 {{- if .Params.menuTitle }} 4 {{- warnf "%q: DEPRECATED frontmatter 'menutitle' found, use 'linktitle' instead" $.File.Filename }} 5 {{- end }} 6 {{- $format := $.format | default (partial "get-format.hugo" .) }} 7 {{- $outputFormat := $.outputFormat | default (partial "output-format.hugo" (dict "page" . "format" $format)) }} 8 {{- $title = .Title }} 9 {{- if $.linkTitle }} 10 {{- $title = or $.page.Params.menuTitle $.page.LinkTitle $title }} 11 {{- end }} 12 13 {{- if eq $outputFormat "searchpage" }} 14 {{- $title = T "Search" }} 15 {{- else if eq .Kind "home" }} 16 {{- $title = or $title site.Title }} 17 {{- else if eq .Kind "taxonomy" }} 18 {{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }} 19 {{- else if eq .Kind "term" }} 20 {{- $taxonomy_page := .Site.GetPage .Data.Plural }} 21 {{- $taxonomy_title := default (default $taxonomy_page.Data.Singular (i18n $taxonomy_page.Data.Singular)) $taxonomy_page.Params.SingularTitle }} 22 {{- $term_title := default (humanize .Data.Term | strings.Title) .Title }} 23 {{- if $.linkTitle }} 24 {{- $title = printf "%s" $term_title }} 25 {{- else if $.reverse }} 26 {{- $title = printf "%s %s %s" $term_title (default "::" .Site.Params.titleSeparator) $taxonomy_title }} 27 {{- else }} 28 {{- $title = printf "%s %s %s" $taxonomy_title (default "::" .Site.Params.titleSeparator) $term_title }} 29 {{- end }} 30 {{- end }} 31 32 {{- if $.fullyQualified }} 33 {{- if and $title site.Title (not (eq $title site.Title)) }} 34 {{- if $.reverse }} 35 {{- $title = printf "%s %s %s" $title (default "::" site.Params.titleSeparator) site.Title }} 36 {{- else }} 37 {{- $title = printf "%s %s %s" site.Title (default "::" site.Params.titleSeparator) $title }} 38 {{- end }} 39 {{- end }} 40 {{- end }} 41 {{- end }} 42 {{- return $title }}