mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-28 07:30:37 +00:00
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
{{ $current := . }}
|
|
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}
|
|
|
|
<!-- templates -->
|
|
{{ define "tree-nav" }}
|
|
{{ $current := .current }}
|
|
|
|
<ul class="gdoc-nav__list">
|
|
{{ range .sect.GroupBy "Weight" }}
|
|
{{ range .ByTitle }}
|
|
{{ if not .Params.GeekdocHidden }}
|
|
<li>
|
|
{{ if or .Content .Params.GeekdocFlatSection }}
|
|
<span class="flex">
|
|
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}">
|
|
{{ partial "title" . }}
|
|
</a>
|
|
</span>
|
|
{{ else }}
|
|
<span class="flex">{{ partial "title" . }}</span>
|
|
{{ end }}
|
|
|
|
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
|
{{ if and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
|
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
|
|
{{ end }}
|
|
</li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
{{ end }}
|