-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
Fix pagination and eleventy computed for .njk
engine
#3120
Merged
zachleat
merged 9 commits into
11ty:v2.x
from
alifeee:fix/pagination-and-eleventyComputed
Jun 10, 2024
Merged
Fix pagination and eleventy computed for .njk
engine
#3120
zachleat
merged 9 commits into
11ty:v2.x
from
alifeee:fix/pagination-and-eleventyComputed
Jun 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it passes for some reason??
they all work apart from nunjucks
This was referenced Dec 10, 2023
alifeee
added a commit
to lipu-tenpo/liputenpo.org
that referenced
this pull request
Dec 14, 2023
tailwind is not intuitive, and adds complexity nunjucks does not work properly -> 11ty/eleventy#3120
Would love to see this merged as this specific issue plagued me all day. |
Shipping with 3.0.0-alpha.11. Thank you! |
Accidentally merged this in 2.x. Again, this will ship with 3.0.0-alpha.11. Thank you! |
cheers ;) enjoy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #2512, #2837, #3013
Introduction
Hi, I hope you are well.
There is a problem where if you use a Nunjucks and a template file like
All
eleventyComputed
variables are blank. See #2512, #2837, #3013 for discussion.This problem was introduced by c6158b0, a commit between
2.0.0-canary.8
and2.0.0-canary.9
.New test
I have added a test which fails:
https://github.com/alifeee/eleventy/blob/301d2c09d76a6bc717a0a8ceda37a1bdb7cdbb42/test/PaginationTest.js#L833-L863
here is a simplification (in the actual test, it tests all templating languages)
Result
This test failed
The fix
I spent some time commiting c6158b0 bit-by-bit and the fix i discovered was this:
I am not fully sure why this is the fix, but I think it is to do with being able to set the
data.eleventyComputed
on a Proxy object.If you re-add this removed code from c6158b0, then, compiling a template complains as the object cannot be assigned unless
set
exists as a property above. Thus, this is the fix I implemented with alifeee@301d2c0And now the test passes
Thank you for your time. I hope this is the correct branch to target with this change.