tags: translate breadcrumb and title for taxonomy #532

This commit is contained in:
Sören Weber 2023-05-20 12:20:58 +02:00
parent 446482a381
commit 25cef423b7
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 14 additions and 4 deletions

View file

@ -9,7 +9,7 @@
{{- if not $title }}
{{- $title = .Data.Singular | humanize }}
{{- end }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (.Title | humanize) }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }}
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
<ul class="columnize">
{{- range sort .Pages "Title" }}

View file

@ -13,6 +13,11 @@
{{- $title := .Title }}
{{- if eq $outputFormat "searchpage" }}
{{- $title = T "Search" }}
{{- else if eq .Kind "taxonomy" }}
{{- $title = i18n .Data.Plural }}
{{- if not $title }}
{{- $title = .Data.Plural | humanize }}
{{- end }}
{{- else if eq .Kind "term" }}
{{- $title = i18n .Data.Singular }}
{{- if not $title }}
@ -179,10 +184,15 @@
{{- if $ispublished }}
{{- $depth = add $depth 1 }}
{{- $title := $to.Title }}
{{- if eq .Kind "term" }}
{{- $title = i18n .Data.Singular }}
{{- if eq .Kind "taxonomy" }}
{{- $title = i18n $to.Data.Plural }}
{{- if not $title }}
{{- $title = .Data.Singular | humanize }}
{{- $title = $to.Data.Plural | humanize }}
{{- end }}
{{- else if eq .Kind "term" }}
{{- $title = i18n $to.Data.Singular }}
{{- if not $title }}
{{- $title = $to.Data.Singular | humanize }}
{{- end }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }}
{{- end }}