modified navigation language list
This commit is contained in:
parent
ae7355b997
commit
461da81c88
1 changed files with 17 additions and 4 deletions
|
@ -31,10 +31,23 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
<!-- Language List -->
|
<!-- Language List -->
|
||||||
<ul class="list-inline text-center mb-0">
|
<select id="select-language" onchange="location = this.value;">
|
||||||
{{ range $.Site.Home.AllTranslations }}
|
{{ $siteLanguages := .Site.Languages}}
|
||||||
<li class="list-inline-item"><a class="text-dark" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
{{ $pageLang := .Page.Lang}}
|
||||||
|
{{ range .Page.AllTranslations }}
|
||||||
|
{{ $translation := .}}
|
||||||
|
{{ range $siteLanguages }}
|
||||||
|
{{ if eq $translation.Lang .Lang }}
|
||||||
|
{{ $selected := false }}
|
||||||
|
{{ if eq $pageLang .Lang}}
|
||||||
|
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}" selected>{{ .LanguageName }}
|
||||||
|
</option>
|
||||||
|
{{ else }}
|
||||||
|
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}">{{ .LanguageName }}</option>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
Loading…
Reference in a new issue