{{- $base_url_parsed := urls.Parse .Site.BaseURL -}} {{- $base_dir := trim $base_url_parsed.Path "/" -}} {{- $base_part_cnt := cond (ne $base_dir "") (len (split $base_dir "/" )) 0 -}} {{- $url_parsed := urls.Parse .Permalink -}} {{- $trimmed_url := trim $url_parsed.Path "/" -}} {{- $pre_url_parts := split $trimmed_url "/" -}} {{- $pre_part_count := len $pre_url_parts -}} {{- $url_parts := last (sub $pre_part_count $base_part_cnt) $pre_url_parts -}} {{- $part_count := len $url_parts -}} {{- $last_part := index $url_parts (sub $part_count 1) -}} {{- $use_part_cnt := cond (eq (trim $last_part " ") "") (sub $part_count 1) $part_count -}} {{- $crumb_is_title := .Site.Params.breadcrumb_use_title | default false -}} {{ .Site.Title }} {{- if gt $use_part_cnt 0 -}} {{- range $cur_ind, $element := first (sub $use_part_cnt 1) $url_parts -}} {{- $path := string (delimit (first (add $cur_ind 1) $url_parts) "/") -}} {{- $part := $element | humanize }} / {{ cond $crumb_is_title ((($.Site.GetPage $path).Title) | default $part) $part }} {{- end -}} {{- $cur_part := (index $url_parts (sub $use_part_cnt 1)) | humanize }} / {{ cond $crumb_is_title (.Title | default $cur_part) $cur_part }} {{- end }}

{{ partial "navigation.html" . }}