mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-22 02:52:23 -06:00
Improve accessibility by adding label to Anchor links.
I ran Lighthouse on just-the-docs and noticed the anchor links were missing a "discernible name". This adds aria-labelledby to the header element to improve these for screenreaders.
This commit is contained in:
parent
50d727871e
commit
bf31b8b9a0
2
_includes/vendor/anchor_headings.html
vendored
2
_includes/vendor/anchor_headings.html
vendored
@ -64,7 +64,7 @@
|
|||||||
{% capture anchor %}{% endcapture %}
|
{% capture anchor %}{% endcapture %}
|
||||||
|
|
||||||
{% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
|
{% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
|
||||||
{% capture anchor %}href="#{{ html_id}}"{% endcapture %}
|
{% capture anchor %}href="#{{ html_id}}" aria-labelledby="{{ html_id}}"{% endcapture %}
|
||||||
|
|
||||||
{% if include.anchorClass %}
|
{% if include.anchorClass %}
|
||||||
{% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %}
|
{% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user