-
|
I'm using a collection of posts by year using this snippet in .eleventy.js: Then I have this template in the root of my src directory: It creates an index of posts by year, e.g. I ask because I am having nothing but trouble trying to extend this to months, e.g. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It looks like your
So in your case, I think the Not sure the best way to extend this to year+month, since that'd be some non-trivial nested double pagination. |
Beta Was this translation helpful? Give feedback.
It looks like your
collections.postsByYearcollection returns an Object (where the stringifiedyearis the key, and array of posts is the value). See https://www.11ty.dev/docs/pagination/#paging-an-objectSo in your case, I think the
yearalias is one of the keys of thecollections.postsByYearobject.Not sure the best way to extend this to year+month, since that'd be so…