2020-01-12 15:33:02 +01:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }}
|
|
|
|
|
2022-01-06 13:58:10 +01:00
|
|
|
|
2021-01-24 11:58:39 +01:00
|
|
|
<!-- template -->
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ define "menu-file" }}
|
2022-01-06 13:58:10 +01:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ $site := .site }}
|
|
|
|
|
2020-01-12 15:33:02 +01:00
|
|
|
|
2022-01-06 13:58:10 +01:00
|
|
|
<ul class="gdoc-nav__list">
|
|
|
|
{{ range sort (default (seq 0) .sect) "weight" }}
|
2022-01-23 22:32:21 +01:00
|
|
|
{{ $name := .name }}
|
|
|
|
{{ if reflect.IsMap .name }}
|
|
|
|
{{ $name = (index .name $site.Language.Lang) }}
|
|
|
|
{{ end }}
|
2020-01-12 15:33:02 +01:00
|
|
|
|
2022-01-06 13:58:10 +01:00
|
|
|
|
|
|
|
<li>
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ $ref := default false .ref }}
|
2022-01-06 13:58:10 +01: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 09:45:54 +02:00
|
|
|
{{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
2022-01-06 13:58:10 +01:00
|
|
|
|
2022-08-04 21:57:02 +02:00
|
|
|
{{ $anchor := default "" .anchor }}
|
|
|
|
{{ if $anchor }}
|
|
|
|
{{ $anchor = printf "#%s" $anchor }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-04-28 11:38:28 +02: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
|
|
|
|
href="{{ if .external }}
|
|
|
|
{{ .ref }}
|
|
|
|
{{- else -}}
|
2022-08-04 21:57:02 +02:00
|
|
|
{{ path.Join $this.RelPermalink $anchor }}
|
2022-04-28 11:38:28 +02: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>
|
2023-04-25 20:29:11 +02:00
|
|
|
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down">
|
2022-04-28 11:38:28 +02:00
|
|
|
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
|
|
|
|
</svg>
|
2022-01-06 13:58:10 +01:00
|
|
|
{{ end }}
|
2022-04-28 11:38:28 +02:00
|
|
|
</label>
|
|
|
|
{{ end }}
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ else }}
|
2022-01-23 13:21:44 +01:00
|
|
|
<span class="flex">{{ $name }}</span>
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ end }}
|
|
|
|
|
2021-01-24 11:58:39 +01:00
|
|
|
{{ with .sub }}
|
2022-01-23 22:32:21 +01:00
|
|
|
{{ template "menu-file" dict "sect" . "current" $current "site" $site }}
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ end }}
|
2022-01-06 13:58:10 +01:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ end }}
|