{{- /* */}} {{- $breadcrumbs := slice }} {{- $path := "" }} {{- if or (eq .Kind "taxonomy") (or (eq .Kind "term") (eq .Kind "404")) }} {{- $path = .RelPermalink }} {{- else if .File }} {{- $path = string .File }} {{- else if .IsHome }} {{- $path = "" }} {{- else }} {{- errorf "Could not find page at url: \"%s\"!" .RelPermalink }} {{- end }} {{- $path = trim $path "/" }} {{- $currentPath := "" }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" "Home" "url" $.Site.BaseURL) }} {{- range split $path "/" }} {{- $currentPath = printf "%s/%s" $currentPath . }} {{- $page := $.GetPage $currentPath }} {{- if not $.IsHome }} {{- if ne . "_index.md" }} {{- if eq $.Kind "404" }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" "Not Found" "url" (printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" $currentPath))) }} {{- else }} {{- $title := $page.Title }} {{- if eq $page $ }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }} {{- else }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink)}} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }}