feat: add collapsible sections to bundle menu (#53)
* feat: add collapsible sections to bundle menu * remove isParent check
This commit is contained in:
parent
38b16f12ee
commit
1c5e86904c
5 changed files with 48 additions and 9 deletions
|
@ -15,9 +15,10 @@
|
|||
{{ $isCurrent := eq $current . }}
|
||||
{{ $isAncestor := .IsAncestor $current }}
|
||||
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
||||
{{ $hasCollapse := and $isParent .Params.GeekdocCollapseSection }}
|
||||
|
||||
<li>
|
||||
{{ if and $isParent .Params.GeekdocCollapseSection }}
|
||||
{{ if $hasCollapse }}
|
||||
<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 }}
|
||||
|
@ -30,7 +31,7 @@
|
|||
{{ else }}
|
||||
<span class="flex">{{ partial "title" . }}</span>
|
||||
{{ end }}
|
||||
{{ if and $isParent .Params.GeekdocCollapseSection }}
|
||||
{{ if $hasCollapse }}
|
||||
<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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue