{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $.Scratch.Add "path" .Site.BaseURL }} {{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) }} {{ range $index, $element := split $url "/" }} {{ $.Scratch.Add "path" $element }} {{ $.Scratch.Add "path" "/" }} {{ if ne $element "" }} {{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) }} {{ end }} {{ end }}