2023-05-21 10:59:32 -07:00

20 lines
847 B
HTML

<!-- Based on https://gohugo.io/content-management/sections/#example-breadcrumb-navigation -->
<!-- Don't show the breadcrumb on the main docs landing page. -->
{{ if ne .RelPermalink "/docs/" }}
<ol class="docs-breadcrumb">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ end }}
{{ define "breadcrumbnav" }}
<!-- Don't include the website home page in the breadcrumb. -->
{{ if and .p1.Parent (ne .p1.Parent .p1.Site.Home) }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2) }}
{{ end }}
<!-- If the page is a redirect page, don't include it in the breadcrumb. -->
{{ if not (isset .p1.Params "redirect_to") }}
<li {{ if eq .p1 .p2 }}class="active"{{ end }}><a data-track="breadcrumb" href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a></li>
{{ end }}
{{ end }}