Open chriskrycho opened 4 years ago
I worked around this issue on my own website in this commit.
@chriskrycho I don't know if it helps, but I have filters for grabbing paginated or non-paginated pages. I think this would help you avoid needing to set standalonePage: true
in your frontmatter.
// Items that are paginated by Eleventy
exports.paginatedOnly = (items) => {
return items.filter( item => {
return (typeof item.data.pagination !== 'undefined')
})
}
// Items that are not paginated
exports.nonPaginatedOnly = (items) => {
return items.filter( item => {
return (typeof item.data.pagination == 'undefined')
})
}
Describe the bug
I'm generating tag pages as suggested by Paging a Collection. In general, this works quite well! 🎉 However, the pages generated this way do not inherit the data from the root template used to generate the paginated view.
The problem here is that the resulting pages don't have any way of filtering on them other than perhaps by URL or digging down into the
data
on the object: they don't appear in any collections generated from the root template in particular. As such, they have to be special-cased in some way.To Reproduce Steps to reproduce the behavior:
pages
collection.addAllPagesToCollections: true
pages
).page
tag), but this does not translate into their being included in the collection generated but that metadata.Expected behavior
Each item rendered by the template is included in whatever collection(s) the template itself is included in and can be filtered accordingly.
Environment: