-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Navigation: Add permalink/url data value? #36
Comments
zachleat
added
the
open-question
Requires additional information before we can proceed.
label
Jan 15, 2018
Added global Documented here: https:/11ty/eleventy/#special-variables and https:/11ty/eleventy/blob/master/docs/collections.md#example-navigation-links-with-an-active-class-added-for-on-the-current-page Do take note that |
🚀 Nice! |
zachleat
added
enhancement
and removed
open-question
Requires additional information before we can proceed.
labels
Apr 17, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking at how to create site navigation for my Eleventy test project.
I do not think Pagination is appropriate for this so I looked at Collections:
Add the following to pages that should have a navigation entry:
.. which would allow a
nav.liquid
partial to usecollection.nav
and the use ofpost.slug
etc.However, (as commented before) there is no easy way to get the 'current active page' and one would have to hardcode a href value (based on e.g. the slug).
This is why I've, for now, fallen back to almost hard-coding the entire navigation:
It would be great to have access to the implicit
permalink
(orurl
) for the current page.Otherwise: what would be an Eleventy best-practice for creating site navigation?
The text was updated successfully, but these errors were encountered: