taxonomy: fix broken term links and breadcrumb #712

This commit is contained in:
Sören Weber 2023-11-03 23:31:49 +01:00
parent cfde15320f
commit 53a2305d70
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@
<ul class="columnize">
{{- end }}
{{- $c:=""}}{{/* display terms of a taxonomy */}}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Term.Page) }}">{{ .Title }}</a> ({{ .Len }})</li>
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page.Page) }}">{{ .Title }}</a> ({{ .Len }})</li>
{{- $lastCapital = $capital }}
{{- end }}
{{- if ne $lastCapital "" }}

View file

@ -14,7 +14,7 @@
{{- $breadcrumb := slice }}
{{- range seq $depth }}
{{- if $to }}
{{- if (default $to.Data.Term $to.Title) }}
{{- if or $to.Title (eq $to.Kind "taxonomy") (eq $to.Kind "term") }}
{{- $breadcrumb = $breadcrumb | append $to }}
{{- end }}
{{- else }}
@ -33,11 +33,11 @@
{{- $depth = add $depth 1 }}
{{- $title := $to.Title }}
{{- if eq $to.Kind "taxonomy" }}
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Title }}
{{- $title = default (default $to.Data.Plural (i18n $to.Data.Plural)) .Title }}
{{- else if eq $to.Kind "term" }}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default $to.Data.Term $to.Title) }}
{{- $taxonomy_page := $to.Site.GetPage $to.Data.Plural }}
{{- $title = default (default $to.Data.Singular (i18n $to.Data.Singular)) $taxonomy_page.Params.SingularTitle }}
{{- $title = printf "%s %s %s" $title (default "::" $to.Site.Params.titleSeparator) (default $to.Data.Term $to.Title) }}
{{- end }}
{{- if not $title }}
{{- $title = $to.Site.Title }}