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

30 lines
No EOL
611 B
HTML

<nav class="breadcrumb-nav">
<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>
</nav>
{{- 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 -}}