mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-22 02:21:37 +01:00
Hide lang switch separator if not multilang
This commit is contained in:
parent
5e61be5903
commit
5dc09b99d8
@ -72,24 +72,26 @@
|
||||
|
||||
{{- $lang := .Lang}}
|
||||
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
|
||||
{{- with site.Home.AllTranslations }}
|
||||
<ul class="lang-switch">
|
||||
{{- if $separator }}<li>|</li>{{ end }}
|
||||
{{- range . -}}
|
||||
{{- if ne $lang .Lang }}
|
||||
<li>
|
||||
<a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}"
|
||||
aria-label="{{ .Language.LanguageName | default (.Lang | title) }}">
|
||||
{{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }}
|
||||
{{- .Language.LanguageName | emojify -}}
|
||||
{{- else }}
|
||||
{{- .Lang | title -}}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end}}
|
||||
</ul>
|
||||
{{- if gt (len site.Home.AllTranslations) 1 }}
|
||||
{{ with site.Home.AllTranslations }}
|
||||
<ul class="lang-switch">
|
||||
{{- if $separator }}<li>|</li>{{ end }}
|
||||
{{- range . -}}
|
||||
{{- if ne $lang .Lang }}
|
||||
<li>
|
||||
<a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}"
|
||||
aria-label="{{ .Language.LanguageName | default (.Lang | title) }}">
|
||||
{{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }}
|
||||
{{- .Language.LanguageName | emojify -}}
|
||||
{{- else }}
|
||||
{{- .Lang | title -}}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end}}
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user