docsy
docsy copied to clipboard
Remove ARIA attributes from taxonomy lists
- Closes #1071
I've chosen to avoid complicating the logic of the breadcrumbs partial since it's complicated enough already. This PR implements what I proposed earlier: it strips out unnecessary classes and irrelevant ARIA labels from the "breadcrumbs" used in the taxonomy lists.
You'll notice that I've removed the disabled
state from the last breadcrumb since it no longer makes sense to disable it (because we're not on that page anymore :)).
Preview: https://deploy-preview-1072--docsydocs.netlify.app/categories/taxonomies/
Screenshots
Before:
After:
/cc @at055612
@at055612 - PTAL and approve if this solution is suitable for you.
@chalin Agree with making the leaf link enabled on the taxonomy results. I think a comment would be useful to explain why the regex replace is there. I did play with passing a flag into the partial to define whether it was a page breadcrumb or not and thus whether to include the aria bits, but it wasn't working for some reason. My only worry with the regex approach is that if someone changes the implementation of the partial they may unknowingly break the the taxonomy results.
I did wander about keeping the aria-label
on the <nav>
but setting its value to "breadcrumb for {{ .LinkTitle }}"
. However I think aria-label
should be unique and we can't guarantee that. Setting it to something like "breadcrumb for result N" would be an option but the partial has no knowledge of its index.
LGTM, though agree with @at055612 that a comment for the regex replace would be useful, especially for future users who might want to modify or override the partial.
Added a comment and rebased. PTAL
Rebased. Pinging @LisaFC and @geriom for a review.
@LisaFC - just a reminder that this is ready for your review.