mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 12:13:19 -06:00
Improve language picker usability
This commit is contained in:
parent
15d9ad52e9
commit
7a73432238
@ -236,6 +236,15 @@ footer {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.langpicker .unavailable {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.langpicker .unavailable:hover {
|
||||||
|
cursor: not-allowed;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Basic elements */
|
/* Basic elements */
|
||||||
|
@ -26,11 +26,27 @@
|
|||||||
{{ partial "icon.html" "world" -}}
|
{{ partial "icon.html" "world" -}}
|
||||||
</summary>
|
</summary>
|
||||||
<ul class="languages">
|
<ul class="languages">
|
||||||
{{ range .Site.Home.AllTranslations }}
|
{{ range .AllTranslations }}
|
||||||
<li>
|
<li>
|
||||||
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $site_translations := slice }}
|
||||||
|
{{ range .Site.Languages }}
|
||||||
|
{{ $site_translations = $site_translations | append .LanguageName }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $translation_codes := slice }}
|
||||||
|
{{ range .AllTranslations }}
|
||||||
|
{{ $translation_codes = $translation_codes | append .Language }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ range (.Site.Languages | complement $translation_codes) }}
|
||||||
|
<li>
|
||||||
|
<a class="langpicker-item unavailable">{{ .LanguageName }}</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user