add new page parameter GeekdocCollapseSection
This commit is contained in:
parent
8a297918e8
commit
5df0ba4b35
12 changed files with 101 additions and 5 deletions
|
@ -9,7 +9,18 @@
|
|||
{{ range .sect.GroupBy "Weight" }}
|
||||
{{ range .ByTitle }}
|
||||
{{ if not .Params.GeekdocHidden }}
|
||||
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ $isCurrent := eq $current . }}
|
||||
{{ $isAncestor := .IsAncestor $current }}
|
||||
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
||||
|
||||
<li>
|
||||
{{ if and $isParent .Params.GeekdocCollapseSection }}
|
||||
<input type="checkbox" id="{{ printf "navtree-%s" $id }}" class="gdoc-nav__toggle" {{ if or $isCurrent $isAncestor }}checked{{ end }}>
|
||||
<label for="{{ printf "navtree-%s" $id }}" class="flex justify-between">
|
||||
{{ end }}
|
||||
{{ if or .Content .Params.GeekdocFlatSection }}
|
||||
<span class="flex">
|
||||
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}">
|
||||
|
@ -19,9 +30,13 @@
|
|||
{{ else }}
|
||||
<span class="flex">{{ partial "title" . }}</span>
|
||||
{{ end }}
|
||||
{{ if and $isParent .Params.GeekdocCollapseSection }}
|
||||
<svg class="icon keyborad_arrow_left"><use xlink:href="#keyborad_arrow_left"></use></svg>
|
||||
<svg class="icon keyborad_arrow_down hidden"><use xlink:href="#keyborad_arrow_down"></use></svg>
|
||||
</label>
|
||||
{{ end }}
|
||||
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ if and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ if $isParent }}
|
||||
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
|
||||
{{ end }}
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue