Welcome to mirror list, hosted at ThFree Co, Russian Federation.

recursive.html « breadcrumbs « partials « layouts - github.com/pjbakker/flexible-seo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b2602cf609d429ee9f773f6c4f410c9521eb5c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{{- $sections := .sections }}
{{- $level := .level }}
{{- $path := .path }}
{{- $dir := .dir }}
{{- $output_type := .output_type }}
{{- $item := print "breadcrumbs/" $output_type "/item.html" }}
{{- $full_data := "" }}

{{- range $sections }}
  {{- $section := index $path $level }}
  {{- $aux := split .RelPermalink "/" }}

  {{- if eq $section (index $aux $level) }}
    {{ $data := partial $item (dict "caption" .Title "url" .RelPermalink "image" .Params.share_img "level" $level "final" (eq ( add $level 2 ) (len $path) ) ) }}
    {{ $full_data = printf "%s%s" $full_data $data }}

    {{- if gt (len .Sections) 0 }}
      {{- $data := partial "breadcrumbs/recursive.html" ( dict "output_type" $output_type "sections" .Sections "level" (add $level 1) "path" $path "dir" $dir ) }}
      {{ $full_data = printf "%s%s" $full_data $data }}
    {{- end }}
  {{- end }}
{{- end }}

{{ return $full_data }}