hugo-theme-hilfe/layouts/partials/menu-filetree.html

33 lines
1.1 KiB
HTML
Raw Normal View History

2020-01-12 15:33:02 +01:00
{{ $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" "desc" }}
{{ range .ByTitle }}
{{ if not .Params.geekdocHidden }}
2020-01-12 15:33:02 +01:00
<li>
{{ if or .Content .Params.geekdocFlatSection }}
2020-01-12 15:33:02 +01:00
<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) }}
2020-01-12 15:33:02 +01:00
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
{{ end }}
</li>
{{ end }}
2020-01-12 15:33:02 +01:00
{{ end }}
{{ end }}
</ul>
{{ end }}