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

With offset config, total posts/items is incorrect #242

Open
JacksonChen666 opened this issue Nov 5, 2022 · 2 comments
Open

With offset config, total posts/items is incorrect #242

JacksonChen666 opened this issue Nov 5, 2022 · 2 comments

Comments

@JacksonChen666
Copy link

When an offset is set, paginator.total_posts returns the total posts minus the offset, which does not represent the actual amount of posts.

@JacksonChen666
Copy link
Author

I found this (scroll a bit down for total_posts description) which means the behavior is correct to the description, just not to my expectation (expected 69, got 64 instead of 69 with the set offset of 5) and probably not the jekyll documentation (for v1).
I don't see an offset option for v1 pagination, so I don't think this issue can be dismissed because of being v1 backwards compatibility. Though, the solution could be a backwards-incompatible change.

@JacksonChen666
Copy link
Author

Workaround (replace all {{ paginator.total_posts }} with): {{ paginator.total_posts | plus: site.pagination.offset }}

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

No branches or pull requests

1 participant