{{- /* */}} {{- $visiblePage := .}} {{- $breadcrumbs := slice }} {{- $path := "" }} {{- if or (eq .Kind "taxonomy") (or (eq .Kind "term") (or (eq .Kind "404") (.File))) }} {{- $path = .RelPermalink }} {{- 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 (trim $currentPath "/") $path }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" $visiblePage.Title "url" $visiblePage.Permalink) }} {{- else }} {{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }}