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 := . }} {{ $current := . }}
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }} {{ template "tree-navx" dict "sect" .Site.Home.Pages "current" $current }}
<!-- templates --> <!-- templates -->
{{ define "tree-nav" }} {{ define "tree-navx" }}
{{ $current := .current }} {{ $current := .current }}
<ul class="gdoc-nav__list"> <ul class="gdoc-nav__list">
@ -16,28 +16,28 @@
{{ $isAncestor := .IsAncestor $current }} {{ $isAncestor := .IsAncestor $current }}
{{ $id := substr (sha1 .Permalink) 0 8 }} {{ $id := substr (sha1 .Permalink) 0 8 }}
{{ if .Content }}
<li> <li>
{{ if and $isParent .Params.GeekdocCollapseSection }} {{ if and $isParent .Params.GeekdocCollapseSection }}
<input type="checkbox" id="{{ printf "navtree-%s" $id }}" class="gdoc-nav__toggle" {{ if or $isCurrent $isAncestor }}checked{{ end }}> <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"> <label for="{{ printf "navtree-%s" $id }}" class="flex justify-between">
{{ end }} {{ end }}
{{ if or .Content .Params.GeekdocFlatSection }} <span class="flex">
<span class="flex"> <a href="{{ .RelPermalink }}" class="gdoc-nav__entry" style="font-weight:normal">
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}"> {{ partial "title" . }}
{{ partial "title" . }} </a>
</a> </span>
</span>
{{ else }}
<span class="flex">{{ partial "title" . }}</span>
{{ end }}
{{ if and $isParent .Params.GeekdocCollapseSection }} {{ 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> <svg class="icon keyborad_arrow_down hidden"><use xlink:href="#keyborad_arrow_down"></use></svg>
</label> </label>
{{ end }} {{ end }}
{{ end }}
{{ if $isParent }} {{ if $isParent }}
{{ template "tree-nav" dict "sect" .Pages "current" $current}} {{ template "tree-navx" dict "sect" .Pages "current" $current}}
{{ end }} {{ end }}
</li> </li>
{{ end }} {{ end }}