Add more semantic HTML and ARIA stuff.

This commit is contained in:
tastytea 2021-03-23 02:45:30 +01:00
parent d18d25cf30
commit 4569349b15
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
4 changed files with 22 additions and 18 deletions

View File

@ -38,7 +38,9 @@
<body> <body>
{{ partial "header.html" . }} {{ partial "header.html" . }}
<main>
{{ block "main" . }}{{ end }} {{ block "main" . }}{{ end }}
</main>
{{ partial "extra_foot.html" . }} {{ partial "extra_foot.html" . }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
</body> </body>

View File

@ -3,11 +3,11 @@
<p id="nocolor_list">{{ .Title }}:</p> <p id="nocolor_list">{{ .Title }}:</p>
<ul> <ul>
{{- range .Paginator.Pages }} {{- range .Paginator.Pages }}
<li> <li role="article">
<div class="post-title"> <section class="post-title" aria-label="Title">
{{- if .Draft }}DRAFT: {{ end }} {{- if .Draft }}DRAFT: {{ end }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a> <a href="{{ .RelPermalink }}">{{ .Title }}</a>
</div> </section>
{{ partial "post_meta.html" . }} {{ partial "post_meta.html" . }}
</li> </li>
{{- end }} {{- end }}

View File

@ -1,8 +1,12 @@
{{- define "main" }} {{- define "main" }}
<h1 class="post-title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1> <article aria-labelledby="nocolor_title">
{{ partial "post_meta.html" . }} <h1 class="post-title" id="nocolor_title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1>
{{ partial "post_meta.html" . }}
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
<article class="content">{{ .Content }}</article> <section class="content" aria-label="Content">
{{ .Content }}
</section>
</article>
{{- end }} {{- end }}

View File

@ -2,18 +2,16 @@
{{- $showfull := default false $.Site.Params.showFullContent }} {{- $showfull := default false $.Site.Params.showFullContent }}
{{- $pagepool := where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} {{- $pagepool := where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }}
{{- range $idx, $_ := (.Paginate $pagepool).Pages }} {{- range $idx, $_ := (.Paginate $pagepool).Pages }}
<div{{ if and $showfull $idx }} class="post-divider"{{ end }}> {{- $contentlabel := cond $showfull "Content" "Summary" }}
<div> <article{{ if and $showfull $idx }} class="post-divider"{{ end }}>
<h2 class="post-title"> <h2 class="post-title">
{{ if .Draft }}DRAFT: {{ end }} {{ if .Draft }}DRAFT: {{ end }}<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a> </h2>
</h2> {{ partial "post_meta.html" . }}
{{ partial "post_meta.html" . }} <section aria-label="{{ $contentlabel }}">
</div>
<div>
{{ cond $showfull .Content .Summary }} {{ cond $showfull .Content .Summary }}
</div> </section>
</div> </article>
{{- end }} {{- end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{- end }} {{- end }}