2024-04-07 19:41:06 +00:00
|
|
|
{{- $title := "" }}
|
|
|
|
{{- with .page }}
|
|
|
|
{{- if .Params.menuTitle }}
|
2024-04-24 20:42:49 +00:00
|
|
|
{{- warnf "%q: UNSUPPORTED frontmatter 'menutitle' found, use 'linktitle' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" $.File.Filename }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- end }}
|
2024-04-27 12:38:19 +00:00
|
|
|
{{- $siteTitle := site.Title }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- $title = .Title }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- if $.linkTitle }}
|
2024-07-21 21:40:57 +00:00
|
|
|
{{- $title = or .LinkTitle $title }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- end }}
|
|
|
|
|
2024-07-21 21:40:57 +00:00
|
|
|
{{- if eq .Kind "home" }}
|
|
|
|
{{- $title = $title | default $siteTitle }}
|
2024-07-21 22:15:38 +00:00
|
|
|
{{- $outputFormat := $.outputFormat }}
|
|
|
|
{{- if not $outputFormat }}
|
|
|
|
{{- $format := $.format | default (partial "get-format.hugo" .) }}
|
|
|
|
{{- $outputFormat = $.outputFormat | default (partial "output-format.hugo" (dict "page" . "format" $format)) }}
|
|
|
|
{{- end }}
|
2024-07-21 21:40:57 +00:00
|
|
|
{{- if eq $outputFormat "searchpage" }}
|
|
|
|
{{- $title = T "Search" }}
|
|
|
|
{{- end }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- else if eq .Kind "taxonomy" }}
|
|
|
|
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Params.Title }}
|
|
|
|
{{- else if eq .Kind "term" }}
|
|
|
|
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
|
|
|
{{- $taxonomy_title := default (default $taxonomy_page.Data.Singular (i18n $taxonomy_page.Data.Singular)) $taxonomy_page.Params.SingularTitle }}
|
|
|
|
{{- $term_title := default (humanize .Data.Term | strings.Title) .Title }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- if $.linkTitle }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- $title = printf "%s" $term_title }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- else if $.reverse }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- $title = printf "%s %s %s" $term_title (default "::" .Site.Params.titleSeparator) $taxonomy_title }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $title = printf "%s %s %s" $taxonomy_title (default "::" .Site.Params.titleSeparator) $term_title }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-04-07 20:13:52 +00:00
|
|
|
|
|
|
|
{{- if $.fullyQualified }}
|
2024-04-27 12:38:19 +00:00
|
|
|
{{- if and $title $siteTitle (not (eq $title $siteTitle)) }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- if $.reverse }}
|
2024-04-27 12:38:19 +00:00
|
|
|
{{- $title = printf "%s %s %s" $title (default "::" site.Params.titleSeparator) $siteTitle }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- else }}
|
2024-04-27 12:38:19 +00:00
|
|
|
{{- $title = printf "%s %s %s" $siteTitle (default "::" site.Params.titleSeparator) $title }}
|
2024-04-07 20:13:52 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- return $title }}
|