Make HTML more semantic and add ARIA labels.

This commit is contained in:
tastytea 2021-03-22 16:33:33 +01:00
parent f98fe34e98
commit 916cc03dd1
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
8 changed files with 24 additions and 24 deletions

View File

@ -1,6 +1,6 @@
{{- define "main" }}
<div>
<p>{{ .Title }}:</p>
<section aria-labelledby="nocolor_list">
<p id="nocolor_list">{{ .Title }}:</p>
<ul>
{{- range .Paginator.Pages }}
<li>
@ -12,6 +12,6 @@
</li>
{{- end }}
</ul>
</div>
</section>
{{ partial "pagination.html" . }}
{{- end }}

View File

@ -4,5 +4,5 @@
{{ partial "toc.html" . }}
<div class="content">{{ .Content }}</div>
<article class="content">{{ .Content }}</article>
{{- end }}

View File

@ -1,6 +1,6 @@
{{- define "main" }}
<div>
<p>{{ .Title }}:</p>
<section aria-labelledby="nocolor_terms">
<p id="nocolor_terms">{{ .Title }}:</p>
<ul>
{{- range .Data.Terms.ByCount }}
{{ $count := .Count }}
@ -12,5 +12,5 @@
{{- end }}
{{- end }}
</ul>
</div>
</section>
{{- end }}

View File

@ -1,6 +1,6 @@
<hr>
<div class="footer">
<div class="nav nav-bottom">
<footer class="footer">
<nav class="nav nav-bottom">
<ul>
{{- range .Site.Menus.footer }}
<li>
@ -17,10 +17,10 @@
</li>
{{- end }}
</ul>
</div>
</nav>
{{- with .Site.Copyright }}
<div class="copyright">
<section class="copyright" aria-label="Copyright">
{{ . }}
</div>
</section>
{{- end }}
</div>
</footer>

View File

@ -1,9 +1,9 @@
<div class="header">
<header class="header">
<a class="title" href="{{ .Site.Home.URL }}">{{ .Site.Title }}</a>
{{- with .Site.Params.subtitle }}
<span class="description">{{ . }}</span>
{{- end }}
</div>
</header>
<nav class="nav nav-top">
<ul>
{{- $curr := . }}

View File

@ -1,7 +1,7 @@
{{ $pag := .Paginator }}
<div class="pagination">
<span>Pages:</span>
<nav class="pagination" aria-labelledby="nocolor_pages">
<span id="nocolor_pages">Pages:</span>
<ul>
<li>
<a href="{{ $pag.First.URL }}">First</a>
@ -45,4 +45,4 @@
<a href="{{ $pag.Last.URL }}">Last</a>
</li>
</ul>
</div>
</nav>

View File

@ -1,7 +1,7 @@
{{- $showdate := default (default true $.Site.Params.showMetaDates) .Params.showmetadates }}
{{- $showlink := default (default true $.Site.Params.showMetaLinks) .Params.showmetalinks }}
{{- if or $showdate $showlink }}
<div class="post-meta">
<section class="post-meta" aria-label="Meta data">
{{- if $showdate }}
<span>Date:</span>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
@ -32,5 +32,5 @@
{{- end }} <!-- if $taxo -->
{{- end }} <!-- range default $fallback .Site.Menus.meta -->
{{- end }} <!-- - if $showlink -->
</div>
</section>
{{- end }} <!-- if or $showdate $showlink -->

View File

@ -1,8 +1,8 @@
{{ if and (gt .WordCount 400 ) (.Params.toc) }}
<aside class="toc">
<aside class="toc" aria-labelledby="nocolor_toc-title">
<header>
<h2>Table of contents</h2>
</header>
{{.TableOfContents}}
<h2 id="nocolor_toc-title">Table of contents</h2>
</header>
{{.TableOfContents}}
</aside>
{{ end }}