mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
taxonomy: fix broken term links and breadcrumb #712
This commit is contained in:
parent
cfde15320f
commit
53a2305d70
2 changed files with 6 additions and 6 deletions
|
@ -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 "" }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue