fix(sidebar): hide translations selector if only one translation available (#950)
hide translations menu if only one translation available
This commit is contained in:
parent
255abd5c88
commit
800f815988
@ -77,15 +77,17 @@
|
|||||||
|
|
||||||
<div class="menu-bottom-section">
|
<div class="menu-bottom-section">
|
||||||
{{- $currentLanguageCode := .Language.Lang -}}
|
{{- $currentLanguageCode := .Language.Lang -}}
|
||||||
{{ with .Site.Home.AllTranslations }}
|
{{ if ( compare.Gt .Site.Home.AllTranslations 1 ) }}
|
||||||
<li id="i18n-switch">
|
{{ with .Site.Home.AllTranslations }}
|
||||||
{{ partial "helper/icon" "language" }}
|
<li id="i18n-switch">
|
||||||
<select name="language" onchange="window.location.href = this.selectedOptions[0].value">
|
{{ partial "helper/icon" "language" }}
|
||||||
{{ range . }}
|
<select name="language" onchange="window.location.href = this.selectedOptions[0].value">
|
||||||
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
|
{{ range . }}
|
||||||
{{ end }}
|
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
|
||||||
</select>
|
{{ end }}
|
||||||
</li>
|
</select>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if (default false .Site.Params.colorScheme.toggle) }}
|
{{ if (default false .Site.Params.colorScheme.toggle) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user