Corrected pagination docs for hidden: true feature #4903

Merged
merged 2 commits into from May 17, 2016

Conversation

Projects
None yet
3 participants
@jehartzog
Contributor

jehartzog commented May 16, 2016

The latest release of Jekyll-Pagination v1.1.0 allows you to exclude published posts from pagination using hidden: true (last requested in #912). This is not reflected in the current Jekyll docs, which in fact says that this type of behavior is not possible.

On my page, I had two types of posts, blog-posts and project pages and I wanted to split them up. Although I was filtering out the project posts from the blog page, the pagination plugin was still counting them in the total count, leading to empty pagination pages (the 'total pages 7' text was for debugging) ss2.

Adding hidden: true to the YAML of my project posts removed them from pagination, allowing my blog page to behavior as expected with no extra blank pagination pages ss3

jekyll/jekyll-paginate#21 has a better fix for this behavior but has not yet been merged, so for now using hidden: true is a good solution and should be documented.

site/_docs/pagination.md
@@ -133,8 +133,8 @@ attributes:
<div class="note info">
<h5>Pagination does not support tags or categories</h5>
<p>Pagination pages through every post in the <code>posts</code>
- variable regardless of variables defined in the YAML Front Matter of
- each. It does not currently allow paging over groups of posts linked
+ variable unless a post has `hidden: true` in its YAML Front Matter.

This comment has been minimized.

@parkr

parkr May 17, 2016

Member

This should be <code>hidden: true</code> because the markdown parser doesn't parse inside HTML blocks. 😄

@parkr

parkr May 17, 2016

Member

This should be <code>hidden: true</code> because the markdown parser doesn't parse inside HTML blocks. 😄

@jehartzog

This comment has been minimized.

Show comment
Hide comment
@jehartzog

jehartzog May 17, 2016

Contributor

@parkr Doh! Thanks for the fix, I should have noticed that, it's used correctly on the line right above!

Contributor

jehartzog commented May 17, 2016

@parkr Doh! Thanks for the fix, I should have noticed that, it's used correctly on the line right above!

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 17, 2016

Member

Great!

@jekyllbot: merge +site

Member

parkr commented May 17, 2016

Great!

@jekyllbot: merge +site

@jekyllbot jekyllbot merged commit cb80934 into jekyll:master May 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request May 17, 2016

@jehartzog jehartzog deleted the jehartzog:fix-pagination-docs branch May 17, 2016

jehartzog added a commit to jehartzog/indigo that referenced this pull request May 18, 2016

@jehartzog jehartzog referenced this pull request in sergiokopplin/indigo May 18, 2016

Merged

Corrected blog pagination jekyll/jekyll#4903 #107

sergiokopplin added a commit to sergiokopplin/indigo that referenced this pull request May 19, 2016

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