0
1
Fork 0
textfiles/layouts/partials/breadcrumb.html

27 lines
852 B
HTML

<ol itemscope itemtype="https://schema.org/BreadcrumbList">
<meta itemprop="name" content="Breadcrumb Navigation">
{{ 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 }}
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a
{{ if eq .p1 .p2 }} class="active"{{ end }}
href="{{ if .p1.IsHome }}{{ relURL "/directory.html" }}{{ else }}{{ .p1.Permalink }}{{ end }}"
itemprop="item"
>
<span itemprop="name">
{{- if .p1.IsHome -}}
Directory
{{- else -}}
{{ .p1.Title }}
{{- end -}}
</span></a>
</li >
{{ end }}