-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Pagination: add pageOnEmptyData option #1698
Conversation
I like this! I wonder if we can brainstorm a better name?
|
@zachleat sure, |
Merged this one (and #1698!) Went with |
@zachleat I love eleventy. working on my first project I came to realize that if no posts exists on a collection where pagination is present, no page will be created, which is understandable. However, I might have a link on my global menu that points to the first page of the collection. Now that link takes the user to an inexistent page Because of this I created an issue: #2928 @pdehaan suggested me to use Now that I know about |
Or maybe |
Currently, if the data to paginate is empty, then eleventy simple generates zero pages. But you might want to always generate at least one page, and if there's no data, then perhaps show a message such as "no entries found", where the paged data would normally appear. This adds a new option
pageOnEmptyData
to pagination, to make such behavior possible.