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>
{{ partial "header.html" . }}
<main>
{{ block "main" . }}{{ end }}
</main>
{{ partial "extra_foot.html" . }}
{{ partial "footer.html" . }}
</body>

View File

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

View File

@ -1,8 +1,12 @@
{{- define "main" }}
<h1 class="post-title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1>
{{ partial "post_meta.html" . }}
<article aria-labelledby="nocolor_title">
<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 }}

View File

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