Use paige.site_title, site.Title as home title fallbacks

This commit is contained in:
Will Faught
2024-05-28 00:21:18 -07:00
parent c62db73ae8
commit 40d808f37c
2 changed files with 30 additions and 6 deletions

View File

@@ -4,8 +4,18 @@
<nav aria-label="{{ i18n `paige_breadcrumbs` }}" class="mt-3" id="paige-breadcrumbs">
<div class="d-flex justify-content-center">
<ol class="breadcrumb mb-0">
{{ range .Reverse }}
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ .Title | markdownify | plainify | htmlUnescape }}</a></li>
{{ $reverse := .Reverse }}
{{ $last := sub (len $reverse) 1 }}
{{ range $i, $ancestor := $reverse }}
{{ $title := $ancestor.Title }}
{{ if and (eq $i $last) (not $title) }}
{{ $title = $page.Param "paige.site_title" | default (site.Title) }}
{{ end }}
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ $title | markdownify | plainify | htmlUnescape }}</a></li>
{{ end }}
</ol>
</div>