Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: resource pagination #12357

Open
warningnonpotablewater opened this issue Apr 10, 2024 · 0 comments
Open

Feature request: resource pagination #12357

warningnonpotablewater opened this issue Apr 10, 2024 · 0 comments

Comments

@warningnonpotablewater
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant