hugo-theme-termlite/layouts/partials/page_breadcrumb.html
Eryn Wells a5e5d04b9f page_breadcrumb: Implement a breadcrumb and display it above the <main> content
The breadcrumb shows navigation from the home page as a path:

/ > Posts > This Post

en.yaml
2024-07-03 07:41:23 -07:00

13 lines
357 B
HTML

<nav class="nav-breadcrumb">
<ol>
{{ range .Ancestors.Reverse }}
{{- $title := .LinkTitle -}}
{{- if .IsHome -}}
{{ $title = "/" }}
{{- end -}}
<li><a href="{{ .Permalink }}">{{ $title }}</a></li>
{{ end }}
<li class="nav-breadcrumb__active"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
</ol>
</nav>