mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-26 02:22:09 +00:00
3200333424
- Shrink some excessive alt text - Remove some redundant links - Screenreaders that split elements up aren't just on touchscreens - Mention ChromeVox in list of screen readers - Move TOC higher in page - Spelling - Drop more unused classes
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
{{ if .Params.footnote_heading -}}
|
|
|
|
<!--Add heading to footnotes-->
|
|
{{ $references := `(<section class="footnotes" role="doc-endnotes">
|
|
<hr>)` -}}
|
|
{{ $heading := .Params.footnote_heading -}}
|
|
{{ $referencesWithHeading := printf `<section role="doc-endnotes" aria-labelledby="note-hd">
|
|
<h2 id="note-hd">%s</h2>` ($heading) -}}
|
|
|
|
<!--Remove deprecated DPUB-ARIA role and unused classes-->
|
|
{{ $endnote := `(role="doc-endnote"|class="footnote-(back)?ref")` }}
|
|
{{ $noEndnote := printf "" }}
|
|
|
|
<!--Add tabindex to all <pre> elements, inc. those that aren't generated by Goldmark-->
|
|
{{ $preWithoutTabIndex := `<pre>` }}
|
|
{{ $preWithTabIndex := `<pre tabindex="0">` }}
|
|
|
|
<!--Move the Table of Contents heading *inside* the <nav> element-->
|
|
{{ $tocHeadingOutside := `<h2>Table of Contents</h2><nav id="TableOfContents">` }}
|
|
{{ $tocHeadingInside := `<nav id=TableOfContents><h2>Table of Contents</h2>` }}
|
|
|
|
{{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $preWithoutTabIndex $preWithTabIndex | replaceRE $tocHeadingOutside $tocHeadingInside | safeHTML -}}
|
|
{{ else -}}
|
|
{{ .Content -}}
|
|
{{ end -}}
|