hugo-theme-zzo/layouts/partials/body/breadcrumb.html

21 lines
783 B
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
<nav class="breadcrumb" aria-label="breadcrumbs">
<ol>
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ 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 }}
2020-01-09 05:25:02 +00:00
<li {{ if eq .p1 .p2 }} class="is-active" {{ end }}>
2019-11-07 18:09:15 +00:00
{{ if eq (len .p1.Title) 0 }}
2020-01-09 05:25:02 +00:00
<a href="{{ .p1.Permalink }}" class="capitalize">{{ .p1.Site.Title }}</a>
{{ else if eq .p1 .p2 }}
<span>{{ i18n (lower .p1.Title) | default .p1.Title }}</span>
2019-11-07 18:09:15 +00:00
{{ else }}
2020-01-09 05:25:02 +00:00
<a href="{{ .p1.Permalink }}" class="capitalize">{{ i18n (lower .p1.Title) | default .p1.Title }}</a>
{{ end }}
2019-11-04 13:09:44 +00:00
</li>
{{ end }}
</nav>