abdullahtarawneh.com/layouts/partials/site/breadcrumbs.html
a 2247ee2776 June 2024 redesign (#1)
still missing some things but they were missing before anyway. so it's probably better to just push and deploy already.

Reviewed-on: #1
2024-06-03 23:22:36 +00:00

20 lines
No EOL
518 B
HTML

<ul class="breadcrumbs">
{{ template "breadcrumb" (dict "p1" . "p2" .) }}
</ul>
{{ define "breadcrumb" }}
{{ if .p1.Parent }}
{{ template "breadcrumb" (dict "p1" .p1.Parent "p2" .p2 ) }}
{{ else if not .p1.IsHome }}
{{ template "breadcrumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
<li {{- if eq .p1 .p2 }} class="active" {{- end }}>
<a href="{{ .p1.RelPermalink }}">
{{ if .p1.IsHome }}
Root
{{ else }}
{{ .p1.Title }}
{{ end }}
</a>
</li>
{{ end }}