2021-01-13 00:31:01 +01:00
|
|
|
{{/*
|
|
|
|
|
|
2026-01-15 18:01:07 +01:00
|
|
|
A copy of the breadcrumb.html partial in Docsy, modified to:
|
|
|
|
|
|
|
|
|
|
* show the breadcrumbs by default by removing the `td-breadcrumbs__single`
|
|
|
|
|
class
|
2021-01-13 00:31:01 +01:00
|
|
|
* omit breadcrumbs when this is the homepage
|
|
|
|
|
* otherwise, include the homepage in the breadcrumbs
|
|
|
|
|
|
|
|
|
|
*/}}
|
|
|
|
|
|
2026-01-15 18:01:07 +01:00
|
|
|
{{ if not .IsHome -}}
|
2024-02-27 19:12:39 +01:00
|
|
|
<nav aria-label="breadcrumb" class="td-breadcrumbs">
|
2026-01-15 18:01:07 +01:00
|
|
|
<ol class="breadcrumb">
|
|
|
|
|
{{- template "breadcrumbnav" (dict "p1" . "p2" .) }}
|
|
|
|
|
</ol>
|
|
|
|
|
</nav>
|
|
|
|
|
{{ end -}}
|
2021-01-13 00:31:01 +01:00
|
|
|
|
2026-01-15 18:01:07 +01:00
|
|
|
{{- define "breadcrumbnav" -}}
|
|
|
|
|
{{ if .p1.Parent -}}
|
|
|
|
|
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) -}}
|
|
|
|
|
{{ else if not .p1.IsHome -}}
|
|
|
|
|
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) -}}
|
|
|
|
|
{{ end -}}
|
|
|
|
|
{{ $isActive := eq .p1 .p2 }}
|
|
|
|
|
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}"
|
|
|
|
|
{{- if $isActive }}aria-current="page"{{ end }}>
|
|
|
|
|
{{ if $isActive -}}
|
|
|
|
|
{{ .p1.LinkTitle -}}
|
|
|
|
|
{{ else -}}
|
|
|
|
|
<a href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</li>
|
|
|
|
|
{{- end -}}
|