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:
parent
42ebf067bb
commit
5c22ce57dc
88 changed files with 437 additions and 144 deletions
|
@ -15,8 +15,15 @@
|
|||
{{ $isCurrent := eq $current $this }}
|
||||
{{ $icon := default false .icon }}
|
||||
|
||||
{{ 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" }}
|
||||
|
||||
{{ if not .icon }}
|
||||
{{ errorf "Missing 'icon' attribute in data file for '%s' menu item '%s'" $target .name }}
|
||||
{{ errorf "Missing 'icon' attribute in data file for '%s' menu item '%s'" $target $name }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq $target "header" }}
|
||||
|
@ -30,7 +37,7 @@
|
|||
class="gdoc-header__link"
|
||||
>
|
||||
<svg class="icon {{ .icon }}">
|
||||
<title>{{ .name }}</title>
|
||||
<title>{{ $name }}</title>
|
||||
<use xlink:href="#{{ .icon }}"></use>
|
||||
</svg>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue