     {{- .Scratch.Set "pages" (.Pages | union .Sections) }}
          {{- end}}
          {{- $pages := (.Scratch.Get "pages") }}

        {{- if eq .Site.Params.ordersectionsby "title"}}
          {{- range $pages.ByTitle }}
            {{- if and .Params.hidden (not $.showhidden) }}
            {{- else}}
              {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "count" (add $.count 1) "tocdepth" $.tocdepth }}
            {{- end}}
          {{- end}}
        {{- else}}
      