-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hey there. It's not 100% clear how you are using your Layouts & Includes. Typically Includes do not have a layout accociated with them. Rather they are inserted into a template with That said, there shouldn't be a difference in the value of That would suggest there is someting else going on. How are you creating your collections? Can you share a repo that replicates the problem you are having? |
Beta Was this translation helpful? Give feedback.
-
|
In
Swapping |
Beta Was this translation helpful? Give feedback.

In
index.njkyou are using{% for item in collections.posts.splice(-5).reverse() %}splice()modifies the original array which Eleventy expects to be static. You almost certainly don't want this.slice()however creates a shallow copy and returns a new array without altering the original.Swapping
splice()forslice()should resolve your issue.