Add a page navigation breadcrumb

This thing looks like a path. It lists the hierarchy of pages from the home page.
This commit is contained in:
Eryn Wells 2024-07-23 08:53:34 -07:00
parent 54c371d7e6
commit d1154de459
3 changed files with 10 additions and 12 deletions

View file

@ -3,11 +3,10 @@
{{ range .Ancestors.Reverse }}
{{- $title := .LinkTitle -}}
{{- if .IsHome -}}
{{ $title = "/" }}
<li class="nav-breadcrumb__home"><a href="{{ .Permalink }}">{{ i18n "home" }}</a></li>
{{ else }}
<li><a href="{{ .Permalink }}">{{ $title }}</a></li>
{{- end -}}
<li><a href="{{ .Permalink }}">{{ $title }}</a></li>
{{ end }}
<li class="nav-breadcrumb__active"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
</ol>
</nav>