about summary refs log tree commit diff stats
path: root/templates/language_switcher.html
diff options
context:
space:
mode:
authorAlan Pearce2024-05-29 16:03:14 +0200
committerAlan Pearce2024-05-29 16:03:14 +0200
commitbe8552ef29fc7b3aa2a2d9de541afe3ce9c24ec0 (patch)
treed84759a2c20320cf3dbb0453208cf16303231c33 /templates/language_switcher.html
parent99423f57f79499f13d021970c1efb4529072006b (diff)
downloadzola-bearblog-be8552ef29fc7b3aa2a2d9de541afe3ce9c24ec0.tar.lz
zola-bearblog-be8552ef29fc7b3aa2a2d9de541afe3ce9c24ec0.tar.zst
zola-bearblog-be8552ef29fc7b3aa2a2d9de541afe3ce9c24ec0.zip
improve accessibility and HTML validity
Diffstat (limited to 'templates/language_switcher.html')
-rw-r--r--templates/language_switcher.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/language_switcher.html b/templates/language_switcher.html
index 04ce9a5..11e2637 100644
--- a/templates/language_switcher.html
+++ b/templates/language_switcher.html
@@ -1,11 +1,11 @@
 {%- if config.extra.language_switcher %}
-  <nav class="lang">
+  <nav class="lang" aria-label="{{ trans(key="language", lang=lang) }}">
     {%- set language_agnostic_path = current_path | default(value="/") | replace(from='/' ~ lang ~ '/', to = '/') | trim_start_matches(pat = '/') %}
     {%- for tr in config.extra.translations %}
       {%- if tr.code == lang %}
-        <active>{{ tr.name }}</active>
+        <span class="active">{{ tr.name }}</span>
       {%- else %}
-          <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}" hreflang="{{ tr.code }}">{{ tr.name }}</a>
+        <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}" hreflang="{{ tr.code }}" lang="{{ tr.code }}">{{ tr.name }}</a>
       {%- endif %}
     {%- endfor %}
   </nav>