--- layout: docs title: Pagination prev_section: permalinks next_section: plugins permalink: /docs/pagination/ --- With many websites—especially blogs—it’s very common to break the main listing of posts up into smaller lists and display them over multiple pages. Jekyll has pagination built-in, so you can automatically generate the appropriate files and folders you need for paginated listings.
Pagination does not work with Markdown or Textile files in your Jekyll site. It will only work when used within HTML files. Since you’ll likely be using this for the list of Posts, this shouldn’t be an issue.
Attribute | Description |
---|---|
|
current page number |
|
number of posts per page |
|
a list of posts for the current page |
|
total number of posts in the site |
|
number of pagination pages |
|
page number of the previous pagination page,
or |
|
path of previous pagination page,
or |
|
page number of the next pagination page,
or |
|
path of next pagination page,
or |
Pagination pages through every post in the posts
variable regardless of variables defined in the YAML Front Matter of
each. It does not currently allow paging over groups of posts linked
by a common tag or category. It cannot include any collection of
documents because it is restricted to posts.
Jekyll does not generate a ‘page1’ folder, so the above code will not work
when a /page1
link is produced. See below for a way to handle
this if it’s a problem for you.