feat: add multilingual mode support (#241)

BREAKING CHANGE:  Layout file renamed ´layouts/partials/page-footer.html → layouts/partials/menu-nextprev.html`. If you use overrides, you might need to change the filenames as well.
This commit is contained in:
Robert Kaussow 2022-01-23 13:21:44 +01:00 committed by GitHub
parent 42ebf067bb
commit 5c22ce57dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
88 changed files with 437 additions and 144 deletions

View file

@ -27,6 +27,13 @@
{{ $id := substr (sha1 $this.Permalink) 0 8 }}
{{ $doCollapse := and (isset . "sub") (or $this.Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
{{ if reflect.IsMap .name }}
{{ $current.Scratch.Set "refName" (index .name $site.Language.Lang) }}
{{ else }}
{{ $current.Scratch.Set "refName" .name }}
{{ end }}
{{ $name := $current.Scratch.Get "refName" }}
<input
type="checkbox"
@ -56,20 +63,20 @@
{{ if $isCurrent }}is-active{{ end }}
{{ end }}"
>
{{ .name }}
{{ $name }}
</a>
</span>
{{ if $doCollapse }}
<svg class="icon gdoc_keyborad_arrow_left">
<svg class="icon toggle gdoc_keyborad_arrow_left">
<use xlink:href="#gdoc_keyborad_arrow_left"></use>
</svg>
<svg class="icon gdoc_keyborad_arrow_down hidden">
<svg class="icon toggle gdoc_keyborad_arrow_down hidden">
<use xlink:href="#gdoc_keyborad_arrow_down"></use>
</svg>
{{ end }}
</label>
{{ else }}
<span class="flex">{{ .name }}</span>
<span class="flex">{{ $name }}</span>
{{ end }}
{{ with .sub }}