{{ $current := . }}
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}


<!-- templates -->
{{ define "tree-nav" }}
  {{ $current := .current }}


  <ul class="gdoc-nav__list">
    {{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }}
    {{ range .sect.GroupBy "Weight" }}
      {{ $rangeBy := .ByTitle }}

      {{ if eq $sortBy "title" }}
        {{ $rangeBy = .ByTitle }}
      {{ else if eq $sortBy "linktitle" }}
        {{ $rangeBy = .ByLinkTitle 