fix(sidebar): improve accessibility of sidebar bottom menu (#925)

* fix(menu): <ol> containing other than <li>, <script> or <template> elements

* fix(menu): add title to language select menu
This commit is contained in:
Jiahao Li
2024-03-02 23:48:34 +01:00
committed by GitHub
parent 65cd7f586f
commit 5b0d6fdf7d
+4 -3
View File
@@ -74,14 +74,15 @@
</a>
</li>
{{ end }}
</ol>
<div class="menu-bottom-section">
<ol class="menu">
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
{{ with .Site.Home.AllTranslations }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
<select name="language" onchange="window.location.href = this.selectedOptions[0].value">
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
{{ range . }}
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
{{ end }}
@@ -97,6 +98,6 @@
<span>{{ T "darkMode" }}</span>
</li>
{{ end }}
</div>
</ol>
</div>
</aside>