mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 20:22:41 +00:00
37 lines
1.6 KiB
HTML
37 lines
1.6 KiB
HTML
{{- if (gt (len .Ancestors.Reverse) 1) | and (eq .Site.Params.breadcrumb.enable true) -}}
|
|
{{- $separator := .Site.Params.breadcrumb.separator | default "/" -}}
|
|
<nav aria-label="breadcrumb" class="breadcrumb-container{{ if .Site.Params.breadcrumb.sticky }} sticky{{ end }}">
|
|
<ol class="breadcrumb">
|
|
{{- range .Ancestors.Reverse -}}
|
|
{{- if .IsHome | and (not .Site.Params.breadcrumb.showHome) -}}
|
|
{{- continue -}}
|
|
{{- end -}}
|
|
|
|
{{- $title := "" -}}
|
|
{{- with .Description -}}
|
|
{{- $title = . -}}
|
|
{{- else -}}
|
|
{{- $title = title .LinkTitle -}}
|
|
{{- if .IsPage | and .Summary -}}
|
|
{{- $title = .Summary -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- $innerText := "" -}}
|
|
{{- if .IsHome -}}
|
|
{{- $innerText = T "single.home" -}}
|
|
{{- else -}}
|
|
{{- $innerText = (T (add .TranslationKey ".breadcrumbTitle")) | default (lower .LinkTitle | T) | default .LinkTitle -}}
|
|
{{- $innerText = cond (.Param "breadcrumb.capitalize") (title $innerText) $innerText -}}
|
|
{{- end -}}
|
|
|
|
<li class="breadcrumb-item" data-separator="{{ $separator }}"><a href="{{ .RelPermalink }}" title="{{ $title }}">{{ $innerText }}</a></li>
|
|
{{- end -}}
|
|
|
|
{{- $currentText := (T (add .TranslationKey ".breadcrumbTitle")) | default (lower .LinkTitle | T) | default .LinkTitle -}}
|
|
{{- $currentText = cond (.Param "breadcrumb.capitalize") (title $currentText) $currentText -}}
|
|
<li class="breadcrumb-item active" data-separator="{{ $separator }}" aria-current="page">{{ $currentText }}</li>
|
|
</ol>
|
|
</nav>
|
|
{{- end -}}
|