Skip to content

Commit

Permalink
taxonomy: fix broken term links and breadcrumb #712
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Nov 3, 2023
1 parent cfde153 commit 53a2305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
<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 "" }}
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down

0 comments on commit 53a2305

Please sign in to comment.