fix: fix rendering issue for untranslated pages in bundle menu (#389)

uci-hugo-doc
Robert Kaussow 2022-04-28 11:38:28 +02:00 committed by GitHub
parent 0a5af2e8da
commit 6d82d6f851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 41 additions and 40 deletions

View File

@ -27,47 +27,48 @@
{{ $id := substr (sha1 $this.Permalink) 0 8 }}
{{ $doCollapse := and (isset . "sub") (or $this.Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
<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>
{{ 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 }}
<a
href="{{ if .external }}
{{ .ref }}
{{ else }}
{{ relref $current .ref }}
{{ 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>
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down hidden">
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
</svg>
{{ end }}
</label>
/>
<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 -}}
{{ $this.RelPermalink }}
{{- 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>
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down hidden">
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
</svg>
{{ end }}
</label>
{{ end }}
{{ else }}
<span class="flex">{{ $name }}</span>
{{ end }}