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 }}
|
2023-06-22 07:45:54 +00:00
|
|
|
{{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
2022-01-06 12:58:10 +00:00
|
|
|
|
2022-08-04 19:57:02 +00:00
|
|
|
{{ $anchor := default "" .anchor }}
|
|
|
|
{{ if $anchor }}
|
|
|
|
{{ $anchor = printf "#%s" $anchor }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-04-28 09:38:28 +00:00
|
|
|
{{ if or .external ($this.RelPermalink) }}
|
|
|
|
<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 }}
|
|
|
|
for="{{ printf "navtree-%s" $id }}" class="flex justify-between align-center"
|
|
|
|
{{ end }}
|
|
|
|
>
|
|
|
|
<span class="flex">
|
|
|
|
{{ if $icon }}
|
|
|
|
<svg class="gdoc-icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
|
|
|
|
{{ end }}
|
|
|
|
<a
|
2024-01-07 13:46:07 +00:00
|
|
|
href="{{ if .external -}}
|
2022-04-28 09:38:28 +00:00
|
|
|
{{ .ref }}
|
|
|
|
{{- else -}}
|
2022-08-04 19:57:02 +00:00
|
|
|
{{ path.Join $this.RelPermalink $anchor }}
|
2022-04-28 09:38:28 +00:00
|
|
|
{{- end }}"
|
|
|
|
class="gdoc-nav__entry{{- if not .external }}
|
|
|
|
{{- if $isCurrent }}{{ printf " is-active" }}{{ end }}
|
|
|
|
{{- end }}"
|
|
|
|
>
|
|
|
|
{{ $name }}
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
{{ if $doCollapse }}
|
|
|
|
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_left">
|
|
|
|
<use xlink:href="#gdoc_keyboard_arrow_left"></use>
|
|
|
|
</svg>
|
2024-01-09 14:21:23 +00:00
|
|
|
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down">
|
2022-04-28 09:38:28 +00:00
|
|
|
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
|
|
|
|
</svg>
|
2022-01-06 12:58:10 +00:00
|
|
|
{{ end }}
|
2022-04-28 09:38:28 +00:00
|
|
|
</label>
|
|
|
|
{{ end }}
|
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 }}
|