trwnh.com/unified.test.hugo/layouts/partials/kb/breadcrumbs.html

30 lines
611 B
HTML
Raw Normal View History

2024-10-05 06:27:07 +00:00
<nav class="breadcrumb-nav">
2024-10-18 07:33:33 +00:00
<div class="container">
<p class="title">You are here:</p>
<ol class="breadcrumbs">
{{- range .Ancestors.Reverse }}
<li><a href="{{.RelPermalink}}">{{ template "name" . }}</a></li>
{{- end }}
<li>{{ template "name" . }}</li>
</ol>
</div>
2024-10-05 06:27:07 +00:00
</nav>
2024-10-18 07:33:33 +00:00
{{- define "name" -}}
{{- $name := "" -}}
{{- if eq .Kind "page" -}}
{{- $name = .File.LogicalName -}}
{{- else -}}
{{- if eq .Kind "section" -}}
{{- $name = .File.ContentBaseName -}}
{{- else -}}
{{- if eq .Kind "home" -}}
{{- $name = or .Title .Site.Title -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $name -}}
{{- end -}}