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

Paginator creates extra empty page if all_posts.size % per_page == 0 #78

appden opened this Issue Aug 17, 2009 · 3 comments


None yet
4 participants

appden commented Aug 17, 2009

The logic Pager.calculate_pages is flawed, and Site:paginate_posts tries to correct for this by adding 1 to the number of pages.

Pager.calculate_pages only needs one line that returns all_posts.size.fdiv(per_page.to_i).ceil and that increment can be removed from Site:paginate_posts (is that how you refer to a private method?).

I barely know Ruby, so please let me know if I made a mistake. Thanks.


This comment has been minimized.


This comment has been minimized.


krisb commented Jan 4, 2010

Fixed this also in my fork with a lot of improvements to the scenarios and tests:


This comment has been minimized.


mojombo commented Jan 9, 2010

I've applied krisb's patch and this is released in 0.5.5.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

pointblack pushed a commit to pointblack/jekyll that referenced this issue Feb 3, 2018

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.