Convert docdock theme from submodule to native files and fix Hugo compatibility
This commit is contained in:
18
themes/docdock/layouts/partials/language-selector.html
Normal file
18
themes/docdock/layouts/partials/language-selector.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- if and .Site.IsMultiLingual (not .Site.Params.DisableLanguageSwitchingButton)}}
|
||||
<select id="select-language" onchange="location = this.value;">
|
||||
{{ $siteLanguages := .Site.Languages}}
|
||||
{{ $pageLang := .Page.Lang}}
|
||||
{{ range .Page.AllTranslations }}
|
||||
{{ $translation := .}}
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ if eq $pageLang .Lang}}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}</option>
|
||||
{{ else }}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user