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