mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-12-24 22:59:21 -05:00
toc: add aria-label for accessibility reasons
- fix: Links do not have a discernible name
This commit is contained in:
parent
795c06b2cc
commit
5264c7011e
@ -62,10 +62,10 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<li>
|
<li>
|
||||||
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a>
|
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<li>
|
<li>
|
||||||
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a>
|
<a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} -->
|
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} -->
|
||||||
@ -81,4 +81,4 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user