<div class="collapse wrap">
  {{ partial "helper/tree-sections.html" . }}
{{ $sections := .Scratch.Get "sections" }}
  {{ $pages := .Scratch.Get "pages" }}
  <h2 class="item title">
    <a href={{- .Site.BaseURL -}}>{{- T "menu.home" -}}</a>
    <small>/ </small>
    {{- T "counter.categories" (dict "d" (len $pages)) -}}
</h2>

  {{ range $index, $page := $pages }}
    {{ $depth := (len (split (strings.TrimPrefix "/posts" $page) "/")) }}
    {{ with $.Site.GetPage $page }}
      {{ $linkTarget := . }}
     