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"> <ul class="columnize">
{{- end }} {{- end }}
{{- $c:=""}}{{/* display terms of a taxonomy */}} {{- $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 }} {{- $lastCapital = $capital }}
{{- end }} {{- end }}
{{- if ne $lastCapital "" }} {{- if ne $lastCapital "" }}

View file

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