eleventy-navigation icon indicating copy to clipboard operation
eleventy-navigation copied to clipboard

Add aria-current option

Open johnhunter opened this issue 3 years ago • 5 comments

Fixes #14

It adds a useAriaCurrentAttr option so that an anchor matching the activeKey will have an aria-current="page" attribute (see more details here).

Example Nunjucks navigation rendering:

{{ collections.all | eleventyNavigation | eleventyNavigationToHtml({
    activeKey: eleventyNavigation.key,
    useAriaCurrentAttr: true
  }) | safe }}

The PR also includes a refactor to make adding tag attributes a bit simpler.

  • [x] Changes have test coverage
  • [x] Have verified works in an Eleventy site build
  • [ ] Documentation updated

johnhunter avatar May 08 '22 11:05 johnhunter

@zachleat Is there anything required for this PR to be merged? I'll raise a PR on the docs site once this one is accepted. Thanks.

johnhunter avatar Feb 27 '23 09:02 johnhunter

+1 for this! 🙂

earlman avatar Jul 26 '23 02:07 earlman

@zachleat @binyamin Please!

Dexus avatar Sep 12 '23 13:09 Dexus

@Dexus I don't have write access to this repository. Sorry.

binyamin avatar Sep 12 '23 17:09 binyamin

@zachleat is there anyone who could review the PR even if they can't merge it? It might help move things along.

Thanks.

johnhunter avatar Sep 12 '23 19:09 johnhunter