about summary refs log tree commit diff stats
path: root/templates
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
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')
-rw-r--r--templates/header.html2
-rw-r--r--templates/language_switcher.html6
-rw-r--r--templates/page.html2
-rw-r--r--templates/section.html14
-rw-r--r--templates/seo_tags.html2
-rw-r--r--templates/style.css.html6
-rw-r--r--templates/taxonomy_list.html14
-rw-r--r--templates/taxonomy_single.html2
8 files changed, 24 insertions, 24 deletions
diff --git a/templates/header.html b/templates/header.html
index 54106ea..acdf8f8 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -3,7 +3,7 @@
   <a href="{{ get_url(path="@/_index.md", lang=lang) }}" class="title">
     <h1>{{ config.title }}</h1>
   </a>
-  <nav>
+  <nav aria-label="{{ trans(key="site", lang=lang)}}">
     {%- include "nav.html" %}
   </nav>
 </header>
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>
diff --git a/templates/page.html b/templates/page.html
index a51d965..336529a 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -9,7 +9,7 @@
     {%- if page.date %}
       <p>
         <i>
-          <time datetime='{{ page.date | date(format='%+') }}' pubdate>
+          <time datetime="{{ page.date | date(format='%+') }}" pubdate>
             {{- page.date | date(format=config.extra.date_format) -}}
           </time>
         </i>
diff --git a/templates/section.html b/templates/section.html
index a389c93..a3520b5 100644
--- a/templates/section.html
+++ b/templates/section.html
@@ -13,7 +13,7 @@
         <li>
           <span>
             <i>
-              <time datetime='{{ page.date | date(format='%+') }}' pubdate>
+              <time datetime="{{ page.date | date(format='%+') }}" pubdate>
                 {{ page.date | date(format=config.extra.date_format) }}
               </time>
             </i>
@@ -24,13 +24,11 @@
         <li>{{ trans(key="no_posts", lang=lang) }}</li>
       {%- endfor -%}
     </ul>
-    <small>
-      <div>
-        {%- set tags = get_taxonomy(kind="tags", lang=lang) %}
-        {%- for post in tags.items %}
+    <div class="tags">
+      {%- set tags = get_taxonomy(kind="tags", lang=lang) %}
+      {%- for post in tags.items %}
         <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
-        {%- endfor %}
-      </div>
-    </small>
+      {%- endfor %}
+    </div>
   </main>
 {% endblock %}
diff --git a/templates/seo_tags.html b/templates/seo_tags.html
index 4eb2bc8..b9a9e84 100644
--- a/templates/seo_tags.html
+++ b/templates/seo_tags.html
@@ -1,2 +1,2 @@
 <meta name="title" content="{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}">
-<meta name="description" content="{{ config.description }}" />
+<meta name="description" content="{{ config.description }}">
diff --git a/templates/style.css.html b/templates/style.css.html
index 2196ce5..bb7915c 100644
--- a/templates/style.css.html
+++ b/templates/style.css.html
@@ -64,7 +64,7 @@
     margin-right: 8px;
   }
 
-  nav active {
+  nav span.active {
     font-weight: bold;
     margin-right: 10px;
   }
@@ -165,3 +165,7 @@
   ul.blog-posts li a:visited {
     color: var(--visited-color);
   }
+
+  .tags {
+    font-size: smaller;
+  }
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html
index f11519d..7ccb4a5 100644
--- a/templates/taxonomy_list.html
+++ b/templates/taxonomy_list.html
@@ -3,13 +3,11 @@
 {% block main %}
   <main>
     <h1>{{ taxonomy.name | capitalize }}</h1>
-    <small>
-      <div>
-        {%- set tags = get_taxonomy(kind="tags", lang=lang) %}
-        {%- for post in tags.items %}
-          <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
-        {%- endfor %}
-      </div>
-    </small>
+    <div class="tags">
+      {%- set tags = get_taxonomy(kind="tags", lang=lang) %}
+      {%- for post in tags.items %}
+        <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
+      {%- endfor %}
+    </div>
   </main>
 {% endblock %}
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html
index ea58c99..2e5533b 100644
--- a/templates/taxonomy_single.html
+++ b/templates/taxonomy_single.html
@@ -13,7 +13,7 @@
         <li>
           <span>
             <i>
-              <time datetime='{{ page.date | date(format='%+') }}' pubdate>
+              <time datetime="{{ page.date | date(format='%+') }}" pubdate>
                 {{ page.date | date(format=config.extra.date_format) }}
               </time>
             </i>