Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active class using page.url - how to? #1183

Closed
jasonday opened this issue May 15, 2020 · 5 comments
Closed

Active class using page.url - how to? #1183

jasonday opened this issue May 15, 2020 · 5 comments

Comments

@jasonday
Copy link

#22

The references in the above issue are no longer active. Is there a how to on incorporating active class (and aria-current="page") on navigation links?

@jasonday
Copy link
Author

and of course I stumbled on this immediately after posting:
https://bryanlrobinson.com/blog/using-nunjucks-if-expressions-to-create-an-active-navigation-state-in-11ty/

Is nunjucks the preferred method or is there an 11ty approach?

@Ryuno-Ki
Copy link
Contributor

Is nunjucks the preferred method or is there an 11ty approach?

Considering #1103 chances are, that Nunjucks will get some priority.

@zachleat
Copy link
Member

Nunjucks is a very popular templating language in Eleventy. But yes I’d say the commentary on #1103 should probably provide more clues. I’ve been loving the upcoming Vue + Eleventy lately 👀

@zachleat
Copy link
Member

I should also note some examples of this with pagination here: https://www.11ty.dev/docs/pagination/nav/#starter-example

@zachleat
Copy link
Member

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and I will reopen the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants