2020-01-12 14:33:02 +00:00
|
|
|
{{ $current := . }}
|
|
|
|
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}
|
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
|
2020-01-12 14:33:02 +00:00
|
|
|
<!-- templates -->
|
|
|
|
{{ define "tree-nav" }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ $current := .current }}
|
2020-01-12 14:33:02 +00:00
|
|
|
|
2021-11-12 07:57:07 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
<ul class="gdoc-nav__list">
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ range .sect.GroupBy "Weight" }}
|
|
|
|
{{ $rangeBy := .ByTitle }}
|
2021-11-12 07:57:07 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ if eq $sortBy "title" }}
|
|
|
|
{{ $rangeBy = .ByTitle }}
|
|
|
|
{{ else if eq $sortBy "linktitle" }}
|
|
|
|
{{ $rangeBy = .ByLinkTitle }}
|
|
|
|
{{ else if eq $sortBy "date" }}
|
|
|
|
{{ $rangeBy = .ByDate }}
|
|
|
|
{{ else if eq $sortBy "publishdate" }}
|
|
|
|
{{ $rangeBy = .ByPublishDate }}
|
|
|
|
{{ else if eq $sortBy "expirydate" }}
|
|
|
|
{{ $rangeBy = .ByExpiryDate }}
|
|
|
|
{{ else if eq $sortBy "lastmod" }}
|
|
|
|
{{ $rangeBy = .ByLastmod }}
|
|
|
|
{{ else if eq $sortBy "title_reverse" }}
|
|
|
|
{{ $rangeBy = .ByTitle.Reverse }}
|
|
|
|
{{ else if eq $sortBy "linktitle_reverse" }}
|
|
|
|
{{ $rangeBy = .ByLinkTitle.Reverse }}
|
|
|
|
{{ else if eq $sortBy "date_reverse" }}
|
|
|
|
{{ $rangeBy = .ByDate.Reverse }}
|
|
|
|
{{ else if eq $sortBy "publishdate_reverse" }}
|
|
|
|
{{ $rangeBy = .ByPublishDate.Reverse }}
|
|
|
|
{{ else if eq $sortBy "expirydate_reverse" }}
|
|
|
|
{{ $rangeBy = .ByExpiryDate.Reverse }}
|
|
|
|
{{ else if eq $sortBy "lastmod_reverse" }}
|
|
|
|
{{ $rangeBy = .ByLastmod.Reverse }}
|
|
|
|
{{ end }}
|
2020-11-16 21:47:50 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ range $rangeBy }}
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ if not .Params.geekdocHidden }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ $isParent := and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ $isCurrent := eq $current . }}
|
|
|
|
{{ $isAncestor := .IsAncestor $current }}
|
|
|
|
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ $doCollapse := and $isParent (or .Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
2022-01-06 12:58:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
{{ if $doCollapse }}
|
|
|
|
class="gdoc-nav__toggle" id="{{ printf "navtree-%s" $id }}"
|
|
|
|
{{ if or $isCurrent $isAncestor }}checked{{ end }}
|
|
|
|
{{ else }}
|
|
|
|
class="hidden"
|
|
|
|
{{ end }}
|
|
|
|
/>
|
|
|
|
<label
|
|
|
|
{{ if $doCollapse }}
|
2022-04-23 13:14:42 +00:00
|
|
|
for="{{ printf "navtree-%s" $id }}" class="flex justify-between align-center"
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ end }}
|
|
|
|
>
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ if or .Content .Params.geekdocFlatSection }}
|
2020-01-12 14:33:02 +00:00
|
|
|
<span class="flex">
|
2022-01-06 12:58:10 +00:00
|
|
|
<a
|
|
|
|
href="{{ .RelPermalink }}"
|
2022-02-07 09:57:43 +00:00
|
|
|
class="gdoc-nav__entry{{- if eq $current . }}
|
|
|
|
{{- printf " is-active" }}
|
|
|
|
{{- end }}"
|
2022-01-06 12:58:10 +00:00
|
|
|
>
|
2022-02-07 09:57:43 +00:00
|
|
|
{{ partial "utils/title" . }}
|
2022-01-06 12:58:10 +00:00
|
|
|
</a>
|
2020-01-12 14:33:02 +00:00
|
|
|
</span>
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ else }}
|
2022-02-07 09:57:43 +00:00
|
|
|
<span class="flex">{{ partial "utils/title" . }}</span>
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ if $doCollapse }}
|
2022-04-18 18:33:23 +00:00
|
|
|
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_left">
|
2022-01-27 21:03:12 +00:00
|
|
|
<use xlink:href="#gdoc_keyboard_arrow_left"></use>
|
2022-01-06 12:58:10 +00:00
|
|
|
</svg>
|
2022-04-18 18:33:23 +00:00
|
|
|
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down">
|
2022-01-27 21:03:12 +00:00
|
|
|
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
|
2022-01-06 12:58:10 +00:00
|
|
|
</svg>
|
|
|
|
{{ end }}
|
2020-11-16 21:47:50 +00:00
|
|
|
</label>
|
2020-01-12 14:33:02 +00:00
|
|
|
|
2020-11-16 21:47:50 +00:00
|
|
|
{{ if $isParent }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ template "tree-nav" dict "sect" .Pages "current" $current }}
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|
2022-01-06 12:58:10 +00:00
|
|
|
</li>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|