Merge pull request #372 from Seirdy/a11y-fixes

A11y fixes
This commit is contained in:
Radek Kozieł 2022-10-22 11:37:49 +02:00 committed by GitHub
commit 21cdda5eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -15,15 +15,15 @@
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }} {{ range $paginator.Pages }}
<div class="post on-list"> <article class="post on-list">
<h1 class="post-title"> <h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1> </h1>
<div class="post-meta"> <div class="post-meta">
{{- with .Date }} {{- with .Date }}
<span class="post-date"> <time class="post-date">
{{ .Format "2006-01-02" }} {{ .Format "2006-01-02" }}
</span> </time>
{{- end }} {{- end }}
{{ with .Params.Author }} {{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span> <span class="post-author">:: {{ . }}</span>
@ -60,7 +60,7 @@
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div> </div>
{{ end }} {{ end }}
</div> </article>
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
</div> </div>

View File

@ -6,16 +6,16 @@
{{ end }} {{ end }}
<div class="posts"> <div class="posts">
{{ range .Paginator.Pages }} {{ range .Paginator.Pages }}
<div class="post on-list"> <article class="post on-list">
<h1 class="post-title"> <h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1> </h1>
<div class="post-meta"> <div class="post-meta">
{{- with .Date }} {{- with .Date }}
<span class="post-date"> <time class="post-date">
{{ .Format "2006-01-02" }} {{ .Format "2006-01-02" }}
</span> </time>
{{- end }} {{- end }}
{{ with .Params.Author }} {{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span> <span class="post-author">:: {{ . }}</span>
{{ end }} {{ end }}
@ -50,7 +50,7 @@
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div> </div>
{{ end }} {{ end }}
</div> </article>
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
</div> </div>

View File

@ -1,13 +1,13 @@
{{ define "main" }} {{ define "main" }}
<div class="post"> <article class="post">
<h1 class="post-title"> <h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta"> <div class="post-meta">
{{ if .Params.Date }} {{ if .Params.Date }}
<span class="post-date"> <span class="post-date">
{{ .Date.Format "2006-01-02" }} <time>{{ .Date.Format "2006-01-02" }}</time>
{{ if $.Site.Params.showLastUpdated }} {{ if $.Site.Params.showLastUpdated }}
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}] [{{or $.Site.Params.updatedDatePrefix "Updated"}}: <time>{{ .Lastmod.Format "2006-01-02" }}</time>]
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}
@ -40,7 +40,7 @@
<div class="post-content"> <div class="post-content">
{{- with .Content -}} {{- with .Content -}}
<div> <div>
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }} {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" aria-label="Anchor">&#8983;</a> ${3}` | safeHTML }}
</div> </div>
{{- end -}} {{- end -}}
</div> </div>
@ -52,5 +52,5 @@
{{ if not (.Params.hideComments | default false) }} {{ if not (.Params.hideComments | default false) }}
{{ partial "comments.html" . }} {{ partial "comments.html" . }}
{{ end }} {{ end }}
</div> </article>
{{ end }} {{ end }}