{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $page := .Page }} {{ $last := false }} {{ $done := false }} {{ range $index := split $url "/" }} {{ if $page }} {{ if not $done }} {{ $.Scratch.Add "urls" (slice $page.Permalink) }} {{ $.Scratch.Add "titles" (slice $page.LinkTitle) }} {{ $.Scratch.Add "descriptions" (slice $page.Description) }} {{ if $last }} {{ $done = true }} {{ end }} {{ $parent := path.Dir (path.Dir $page.File.Path) }} {{ if eq $parent "." }} {{ $last = true }} {{ $page = $page.Site.GetPage "home" }} {{ else }} {{ $page = $page.GetPage $parent }} {{ end }} {{ end }} {{ end }} {{ end }}