{{- $breadcrumbs := slice }} {{- $path := .page.RelPermalink }} {{- $path = trim $path "/" }} {{- $currentPath := "" }} {{- range split $path "/" }} {{- $currentPath = printf "%s/%s" $currentPath . }} {{- $page := $.page.GetPage $currentPath }} {{- if ne (trim $currentPath "/") $path }} {{- $title := $page.Title }} {{- with $page.Params.breadcrumb }} {{- $title = . }} {{- end }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }} {{- end }} {{- end }} {{- $breadcrumbs = after (int .page.IsPage) $breadcrumbs}} {{- if ne .page.Type "page"}} {{- if lt (default 0 .min) (len $breadcrumbs) }} {{- range $index, $breadcrumb := $breadcrumbs }} {{ $breadcrumb.name }}{{ if ne $index (sub (len $breadcrumbs) 1) }} > {{ end }} {{- end }} {{- if and $breadcrumbs .end }} {{ .end }} {{- end }} {{- end }} {{- end }}