2020-01-12 14:33:02 +00:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }}
|
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
|
2021-01-24 10:58:39 +00:00
|
|
|
<!-- template -->
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ define "menu-file" }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ $site := .site }}
|
|
|
|
|
2020-01-12 14:33:02 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
<ul class="gdoc-nav__list">
|
|
|
|
{{ range sort (default (seq 0) .sect) "weight" }}
|
2022-01-23 21:32:21 +00:00
|
|
|
{{ $name := .name }}
|
|
|
|
{{ if reflect.IsMap .name }}
|
|
|
|
{{ $name = (index .name $site.Language.Lang) }}
|
|
|
|
{{ end }}
|
2020-01-12 14:33:02 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
|
|
|
|
<li>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ $ref := default false .ref }}
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ if $ref }}
|
|
|
|
{{ $this := $site.GetPage .ref }}
|
|
|
|
{{ $icon := default false .icon }}
|
|
|
|
{{ $numberOfPages := (add (len $this.Pages) (len $this.Sections)) }}
|
|
|
|
{{ $isCurrent := eq $current $this }}
|
|
|
|
{{ $isAncestor := $this.IsAncestor $current }}
|
|
|
|
{{ $id := substr (sha1 $this.Permalink) 0 8 }}
|
|
|
|
{{ $doCollapse := and (isset . "sub") (or $this.Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
|
|
|
|
2020-01-12 14:33:02 +00:00
|
|
|
|
2022-01-06 12:58:10 +00:00
|
|
|
<input
|
|
|
|
type="checkbox"
|
2021-07-10 11:17:16 +00:00
|
|
|
{{ if $doCollapse }}
|
2022-01-06 12:58:10 +00:00
|
|
|
class="gdoc-nav__toggle" id="{{ printf "navtree-%s" $id }}"
|
|
|
|
{{ if or $isCurrent $isAncestor }}checked{{ end }}
|
|
|
|
{{ else }}
|
|
|
|
class="hidden"
|
2021-01-24 10:58:39 +00:00
|
|
|
{{ end }}
|
2022-01-06 12:58:10 +00:00
|
|
|
/>
|
|
|
|
<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 }}
|
|
|
|
>
|
2020-01-12 14:33:02 +00:00
|
|
|
<span class="flex">
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ if $icon }}
|
2022-04-18 18:33:23 +00:00
|
|
|
<svg class="gdoc-icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ end }}
|
|
|
|
<a
|
|
|
|
href="{{ if .external }}
|
|
|
|
{{ .ref }}
|
|
|
|
{{ else }}
|
|
|
|
{{ relref $current .ref }}
|
|
|
|
{{ end }}"
|
2022-02-07 09:57:43 +00:00
|
|
|
class="gdoc-nav__entry{{- if not .external }}
|
|
|
|
{{- if $isCurrent }}{{ printf " is-active" }}{{ end }}
|
|
|
|
{{- end }}"
|
2022-01-06 12:58:10 +00:00
|
|
|
>
|
2022-01-23 12:21:44 +00:00
|
|
|
{{ $name }}
|
2022-01-06 12:58:10 +00:00
|
|
|
</a>
|
2020-01-12 14:33:02 +00:00
|
|
|
</span>
|
2021-07-10 11:17:16 +00:00
|
|
|
{{ 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 hidden">
|
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>
|
2021-01-24 10:58:39 +00:00
|
|
|
{{ end }}
|
2022-01-06 12:58:10 +00:00
|
|
|
</label>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ else }}
|
2022-01-23 12:21:44 +00:00
|
|
|
<span class="flex">{{ $name }}</span>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|
|
|
|
|
2021-01-24 10:58:39 +00:00
|
|
|
{{ with .sub }}
|
2022-01-23 21:32:21 +00:00
|
|
|
{{ template "menu-file" dict "sect" . "current" $current "site" $site }}
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|
2022-01-06 12:58:10 +00:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
2020-01-12 14:33:02 +00:00
|
|
|
{{ end }}
|