modify filetree layout template to only show on .Content and change style of link made and right arrow

master
David Kebler 2021-01-15 11:55:11 -08:00
parent 4babb900e6
commit f90fc83b76
1 changed files with 13 additions and 13 deletions

View File

@ -1,8 +1,8 @@
{{ $current := . }}
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}
{{ template "tree-navx" dict "sect" .Site.Home.Pages "current" $current }}
<!-- templates -->
{{ define "tree-nav" }}
{{ define "tree-navx" }}
{{ $current := .current }}
<ul class="gdoc-nav__list">
@ -16,28 +16,28 @@
{{ $isAncestor := .IsAncestor $current }}
{{ $id := substr (sha1 .Permalink) 0 8 }}
{{ if .Content }}
<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 }}">
{{ partial "title" . }}
</a>
</span>
{{ else }}
<span class="flex">{{ partial "title" . }}</span>
{{ end }}
<span class="flex">
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry" style="font-weight:normal">
{{ partial "title" . }}
</a>
</span>
{{ if and $isParent .Params.GeekdocCollapseSection }}
<svg class="icon keyborad_arrow_left"><use xlink:href="#keyborad_arrow_left"></use></svg>
<svg class="icon keyborad_arrow_left"><use xlink:href="#keyborad_arrow_right"></use></svg>
<svg class="icon keyborad_arrow_down hidden"><use xlink:href="#keyborad_arrow_down"></use></svg>
</label>
{{ end }}
{{ end }}
{{ if $isParent }}
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
{{ template "tree-navx" dict "sect" .Pages "current" $current}}
{{ end }}
</li>
{{ end }}