Skip to content
Discussion options

You must be logged in to vote

"But there are aspects that I don't understand. For instance, what does the alias year refer to? The data is a collection. Is year the index of an array of posts?"

It looks like your collections.postsByYear collection returns an Object (where the stringified year is the key, and array of posts is the value). See https://www.11ty.dev/docs/pagination/#paging-an-object

"Eleventy does allow paging objects too. Objects are resolved to pagination arrays using either the Object.keys() or Object.values() JavaScript functions."

So in your case, I think the year alias is one of the keys of the collections.postsByYear object.

Not sure the best way to extend this to year+month, since that'd be so…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btrem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants