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