{{ if .Site.Params.displayListTitle }}

{{ .Title | default (.Type | title) }}

{{ end }}
    {{ partial "utils/tree-sections.html" . }} {{ $sections := .Scratch.Get "sections" }} {{ $pages := .Scratch.Get "pages" }} {{ range $index, $page := $pages }} {{ $depth := (len (split (strings.TrimPrefix "/" $page) "/")) }} {{ with $.Site.GetPage $page }} {{ $linkTarget := . }} {{ $depthPrev := 0 }} {{ if ge $index 1 }} {{ $pagePrev := index $pages (sub $index 1) }} {{ $depthPrev = len (split (strings.TrimPrefix "/" $pagePrev) "/") }} {{ end }} {{ $depthNext := 0 }} {{ if lt $index (sub (len $pages) 1) }} {{ $pageNext := index $pages (add $index 1) }} {{ $depthNext = len (split (strings.TrimPrefix "/" $pageNext) "/") }} {{ end }} {{ if or (le $depth $depthPrev) (eq $index 0) }}
  • {{ end }} {{ if and (gt $depth $depthPrev) (ne $index 0) }}
    • {{ end }} {{ $name := index $sections $index }} {{ .LinkTitle | default $name }} {{ if $.Site.Params.displayPostsCount }} {{ $sectionPage := .CurrentSection }} {{ $.Scratch.Delete "pages" }} {{ range $.Site.RegularPages }} {{ if (.IsDescendant $sectionPage) }} {{ $.Scratch.Add "pages" (slice .) }} {{ end }} {{ end }} {{ $pages := $.Scratch.Get "pages" }} {{ printf "(%d)" (len $pages) }} {{ end }} {{ if $.Site.Params.displayPosts }} {{ $sectionPage := .CurrentSection }} {{ $.Scratch.Delete "pages" }} {{ range $.Site.RegularPages }} {{ if (.InSection $sectionPage) }} {{ $.Scratch.Add "pages" (slice .) }} {{ end }} {{ end }} {{ $pages := $.Scratch.Get "pages" }} {{ partial "utils/limit-tree-posts.html" (dict "$" $ "pages" $pages "linkTarget" $linkTarget) }} {{ end }} {{ if and (gt $depth $depthNext) (ne $index (sub (len $pages) 1)) }} {{ range seq (sub $depth $depthNext) }} {{ if le . (sub $depth $depthNext) }}
    {{ end }} {{ end }} {{ end }} {{ if ge $depth $depthNext }}
  • {{ end }} {{ end }} {{ end }}