Add aria-labels for header links

master
Will Faught 3 years ago
parent d39846cbb3
commit a702e275fe

@ -3,7 +3,7 @@
{{ if .Scratch.Get "paige_show_full_pages" }} {{ if .Scratch.Get "paige_show_full_pages" }}
{{ .Content }} {{ .Content }}
{{ else }} {{ else }}
{{ .Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML }} {{ .Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML }}
{{ end }} {{ end }}
</section> </section>
{{ end }} {{ end }}

@ -4,5 +4,5 @@
{{ $class = "display-1" }} {{ $class = "display-1" }}
{{ end }} {{ end }}
{{ $title := .Title | markdownify }} {{ $title := .Title | markdownify }}
<h1 class="{{ $class }} fw-bold text-center">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1> <h1 class="{{ $class }} fw-bold text-center">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
{{ end }} {{ end }}

Loading…
Cancel
Save