{{- $outputFormat := partial "output-format.hugo" . }} {{- partial "meta.html" . }} {{- $page := . }} {{- $link := "" }} {{- $title := "" }} {{- if and .Title (not (eq .Title .Site.Title)) }} {{- $title = printf "%s %s " .Title (default "::" .Site.Params.titleSeparator) }} {{- end }} {{- $title = printf "%s%s" $title .Site.Title }} {{ $title }} {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- else }} {{- range .AlternativeOutputFormats }} {{- if eq .Rel "canonical" }} {{ (printf $link .Permalink .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }} {{- 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 "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" . }}
{{- partial "tags.html" . }}
{{- define "breadcrumb" }} {{- $breadcrumb := slice }} {{- $page := .page }} {{- $to := .to }} {{- $breadcrumb = $breadcrumb | append $to }} {{- range seq (len .to.Site.Home.Pages) }} {{- $to = $to.Parent }} {{- if $to }} {{- $breadcrumb = $breadcrumb | append $to }} {{- else }} {{- break }} {{- end }} {{- end }} {{- $len := len $breadcrumb -}} {{- $breadcrumbReversed := slice }} {{- range seq $len }} {{- $breadcrumbReversed = $breadcrumbReversed | append (index $breadcrumb (sub $len .)) }} {{- end }} {{- $remaining := $len }} {{- $depth := 0 }} {{- range $i, $e := $breadcrumbReversed }} {{- $to := $e }} {{- $ispublished := gt (int (len $to.Permalink)) 0 }} {{- $remaining = sub $remaining 1 }} {{- if $ispublished }} {{- $depth = add $depth 1 }}
  • {{ if $remaining }}{{end}}{{ if $to.Title }}{{ $to.Title }}{{ else }}{{ $to.Site.Title }}{{ end }}{{ if $remaining }}{{ end }}{{ if $remaining }} > {{ end }}
  • {{- end }} {{- end }} {{- end }}