{{- $format := partial "get-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} {{- if eq $outputFormat "searchpage" }} {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} {{- end }} {{- partial "meta.html" . }} {{- $page := . }} {{- $link := "" }} {{- $title := .Title }} {{- if eq $outputFormat "searchpage" }} {{- $title = T "Search" }} {{- else if eq .Kind "taxonomy" }} {{- $title = i18n .Data.Plural }} {{- if not $title }} {{- $title = .Data.Plural }} {{- end }} {{- else if eq .Kind "term" }} {{- $title = i18n .Data.Singular }} {{- if not $title }} {{- $title = .Data.Singular }} {{- end }} {{- $title = printf "%s %s %s" .Title (default "::" .Site.Params.titleSeparator) $title }} {{- end }} {{- if and $title .Site.Title (not (eq $title .Site.Title)) }} {{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }} {{- end }} {{ $title }} {{- if .IsTranslated -}} {{- range $index, $trans := .AllTranslations }} {{- if eq $index 0 }} {{- end }} {{- end }} {{- end }} {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- else }} {{- range .AlternativeOutputFormats }} {{- if eq .Rel "canonical" }} {{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} {{- else if eq $outputFormat "searchpage" }} {{- else if eq .Name "SEARCHPAGE" }} {{- else if and (ne .Name "JSON") (ne .Name "SEARCH") }} {{ (printf $link (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} {{- end }} {{- end }} {{- end }} {{- if and (ne .Site.Params.disableSeoHiddenPages true) (ne .Site.Params.disableSearchHiddenPages true) }} {{- range .AlternativeOutputFormats }} {{- if eq .Name "SEARCHPAGE" }} {{- else if eq .Name "JSON" }} {{ (printf $link (.Permalink | relURL) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} {{- end }} {{- end }} {{- end }} {{- partialCached "favicon.html" . }} {{- partialCached "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) $outputFormat }} {{- partial "custom-header.html" . }}
{{- $hook := "styleclass" }}
{{- define "breadcrumb" }} {{- $breadcrumb := slice }} {{- $page := .page }} {{- $pageurl := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }} {{- $to := .to }} {{- $breadcrumb = $breadcrumb | append $to }} {{- $depth := int (partial "get-page-depth.hugo" (dict "page" $page)) }} {{- range seq $depth }} {{- $to = $to.Parent }} {{- if $to }} {{- if $to.Title }} {{- $breadcrumb = $breadcrumb | append $to }} {{- end }} {{- else }} {{- break }} {{- end }} {{- end }} {{- $len := len $breadcrumb -}} {{- $breadcrumbReversed := slice }} {{- range seq $len }} {{- $breadcrumbReversed = $breadcrumbReversed | append (index $breadcrumb (sub $len .)) }} {{- end }} {{- $depth := 0 }} {{- range $i, $e := $breadcrumbReversed }} {{- $to := $e }} {{- $depth = add $depth 1 }} {{- $title := $to.Title }} {{- if eq .Kind "taxonomy" }} {{- $title = i18n $to.Data.Plural }} {{- if not $title }} {{- $title = $to.Data.Plural }} {{- end }} {{- else if eq .Kind "term" }} {{- $title = i18n $to.Data.Singular }} {{- if not $title }} {{- $title = $to.Data.Singular }} {{- end }} {{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }} {{- end }} {{- if not $title }} {{- $title = $to.Site.Title }} {{- end }} {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }} {{- $last := eq $url $pageurl }} {{- $link := and $url (not $last) }} {{- printf "{{ if $link }}{{end}}{{ $title }}{{ if $link }}{{ end }}{{ if not $last }}{{ (printf " %s " (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }} {{- end }} {{- end }}