mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-02-08 03:19:02 +00:00
15 lines
567 B
HTML
15 lines
567 B
HTML
<nav class="{{ .class }}">
|
|
{{ template "breadcrumbnav" (dict "p1" .context "p2" .context "childClass" .childClass) }}
|
|
</nav>
|
|
|
|
{{- define "breadcrumbnav" -}}
|
|
{{- if .p1.Parent -}}
|
|
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 "childClass" .childClass ) }}
|
|
{{- else if not .p1.IsHome -}}
|
|
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 "childClass" .childClass) }}
|
|
{{- end -}}
|
|
|
|
{{- $isCurrent := eq .p1 .p2 -}}
|
|
<a class="{{ .childClass }}{{ if $isCurrent }}--active{{ end }}" href="{{ .p1.Permalink }}">{{ .p1.Title }}</a>
|
|
{{- end -}}
|