 {{- else }}
      {{- break }}
    {{- end }}
  {{- end }}
  {{- $len := len $breadcrumb -}}
  {{- $breadcrumbReversed := slice }}
  {{- range seq $len }}
    {{- $breadcrumbReversed = $breadcrumbReversed | append (index $breadcrumb (sub $len .)) }}
  {{- end }}
  {{- $remaining := $len }}
  {{- $depth := 0 }}
  {{- range $i, $e := $breadcrumbReversed }}
    {{- $to := $e }}
    {{- $ispublished := gt (int (len $to.Permalink)) 0 }}
    {{- $remaining = sub $remaining 1 }}
    {{- if $ispublished }}
      {