You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the .Paginate method only accepts pages and page groups. I propose to expand it to also allow resources since it helps greatly with 3 specific use cases:
1. Paginated galleries
As far as I can tell, at the moment, there's no trivial way to implement them other than by making a page for every image and paginating them instead. This approach is not ideal because it requires a lot of manual intervention and, as a result, doesn't scale well.
A better approach would be to iterate over images directly, which requires support for resource pagination.
2. Multi-page posts
At the moment, the only way to implement them is by putting build options on every page to prevent them from rendering and then including their full content in the pagination. Apart from being quite hacky, it also breaks images on the inlined pages and introduces hurdles when writing navigation templates (like HTML sitemaps and file index style navigation) - you have to add a condition to purposefully exclude pages with render: false which is easy to miss.
A better way to do this would be to use leaf bundles and treat pages as resources. In order to then paginate them, however, you also need resource pagination.
3. Static microblogs
Or in other words, pagination where separate posts don't have their own URLs and only live on the page they're paginated on. This has the same issues and the same solution as multi-page posts since their implementation only differs in the number of posts per page (1 vs many).
The text was updated successfully, but these errors were encountered:
Currently, the
.Paginate
method only accepts pages and page groups. I propose to expand it to also allow resources since it helps greatly with 3 specific use cases:1. Paginated galleries
As far as I can tell, at the moment, there's no trivial way to implement them other than by making a page for every image and paginating them instead. This approach is not ideal because it requires a lot of manual intervention and, as a result, doesn't scale well.
A better approach would be to iterate over images directly, which requires support for resource pagination.
2. Multi-page posts
At the moment, the only way to implement them is by putting build options on every page to prevent them from rendering and then including their full content in the pagination. Apart from being quite hacky, it also breaks images on the inlined pages and introduces hurdles when writing navigation templates (like HTML sitemaps and file index style navigation) - you have to add a condition to purposefully exclude pages with
render: false
which is easy to miss.A better way to do this would be to use leaf bundles and treat pages as resources. In order to then paginate them, however, you also need resource pagination.
3. Static microblogs
Or in other words, pagination where separate posts don't have their own URLs and only live on the page they're paginated on. This has the same issues and the same solution as multi-page posts since their implementation only differs in the number of posts per page (1 vs many).
The text was updated successfully, but these errors were encountered: