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

@ -1,60 +1,72 @@
<header class="gdoc-header">
<div class="container flex align-center justify-between">
{{ if .MenuEnabled }}
<label for="menu-control" class="gdoc-nav__control">
<label for="menu-control" class="gdoc-nav__control" tabindex="0">
<svg class="icon gdoc_menu">
<title>Open Nav Menu</title>
<title>{{ i18n "button_nav_open" }}</title>
<use xlink:href="#gdoc_menu"></use>
</svg>
<svg class="icon gdoc_arrow_back">
<title>Close Nav Menu</title>
<title>{{ i18n "button_nav_close" }}</title>
<use xlink:href="#gdoc_arrow_back"></use>
</svg>
</label>
{{ end }}
<a class="gdoc-header__link" href="{{ .Root.Site.BaseURL }}">
<span class="gdoc-brand flex align-center">
<img
class="gdoc-brand__img"
src="{{ (default "brand.svg" .Root.Site.Params.GeekdocLogo) | relURL }}"
alt=""
/>
<span class="gdoc-brand__title">{{ .Root.Site.Title }}</span>
</span>
</a>
<div>
<a class="gdoc-brand gdoc-header__link" href="{{ .Root.Site.BaseURL }}">
<span class="flex align-center">
<img
class="gdoc-brand__img"
src="{{ (default "brand.svg" .Root.Site.Params.GeekdocLogo) | relURL }}"
alt=""
/>
<span class="gdoc-brand__title">{{ .Root.Site.Title }}</span>
</span>
</a>
</div>
<div class="gdoc-menu-header">
<span {{ if .Root.Site.Data.menu.extra.header }}class="gdoc-menu-header__items"{{ end }}>
<span
{{ if .Root.Site.Data.menu.extra.header }}class="gdoc-menu-header__items"{{ end }}
>
{{ if .Root.Site.Data.menu.extra.header }}
{{ partial "menu-extra" (dict "current" .Root "source" .Root.Site.Data.menu.extra.header "target" "header") }}
{{ end }}
<span id="gdoc-dark-mode">
<svg class="icon gdoc_brightness_dark">
<title>Toggle Dark/Light/Auto mode</title>
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gdoc_brightness_dark"></use>
</svg>
<svg class="icon gdoc_brightness_light">
<title>Toggle Dark/Light/Auto mode</title>
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gdoc_brightness_light"></use>
</svg>
<svg class="icon gdoc_brightness_auto">
<title>Toggle Dark/Light/Auto mode</title>
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gdoc_brightness_auto"></use>
</svg>
</span>
{{ if .Root.Site.Data.menu.extra.header }}
<span class="gdoc-menu-header__home">
<a href="{{ .Root.Site.BaseURL }}" class="gdoc-header__link">
<svg class="icon gdoc_home">
<title>Back to homepage</title>
<title>{{ i18n "button_homepage" }}</title>
<use xlink:href="#gdoc_home"></use>
</svg>
</a>
</span>
{{ end }}
{{ partial "language" .Root }}
{{ if .Root.Site.Data.menu.extra.header }}
<span class="gdoc-menu-header__control">
<label for="menu-header-control">
<svg class="icon gdoc_keyborad_arrow_right">
<use xlink:href="#gdoc_keyborad_arrow_right"></use>
<title>Close Menu Bar</title>
<title>{{ i18n "button_menu_close" }}</title>
</svg>
</label>
</span>
@ -64,7 +76,7 @@
<label for="menu-header-control" class="gdoc-menu-header__control">
<svg class="icon gdoc_keyborad_arrow_left">
<use xlink:href="#gdoc_keyborad_arrow_left"></use>
<title>Open Menu Bar</title>
<title>{{ i18n "button_menu_open" }}</title>
</svg>
</label>
{{ end }}