Skip to content

Commit

Permalink
tags: translate breadcrumb and title for taxonomy #532
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed May 20, 2023
1 parent 446482a commit 25cef42
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/term.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand Down
16 changes: 13 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 = $to.Data.Plural | humanize }}
{{- end }}
{{- else if eq .Kind "term" }}
{{- $title = i18n $to.Data.Singular }}
{{- if not $title }}
{{- $title = .Data.Singular | humanize }}
{{- $title = $to.Data.Singular | humanize }}
{{- end }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }}
{{- end }}
Expand Down

0 comments on commit 25cef42

Please sign in to comment.