Add some docs regarding what the paginator exposes in liquid

This commit is contained in:
Parker Moore 2013-04-09 20:11:12 +02:00
parent c0f50f2c78
commit 102e29899f
1 changed files with 52 additions and 0 deletions

View File

@ -31,6 +31,58 @@ paginate: 5
The number should be the maximum number of Posts youd like to be displayed per- The number should be the maximum number of Posts youd like to be displayed per-
page in the generated site. page in the generated site.
## Liquid Attributes Available
The pagination plugin exposes the `paginator` liquid object with the following
attributes:
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>page</code></p></td>
<td><p>current page number</p></td>
</tr>
<tr>
<td><p><code>per_page</code></p></td>
<td><p>number of posts per page</p></td>
</tr>
<tr>
<td><p><code>posts</code></p></td>
<td><p>a list of posts for the current page</p></td>
</tr>
<tr>
<td><p><code>total_posts</code></p></td>
<td><p>total number of posts in the site</p></td>
</tr>
<tr>
<td><p><code>total_pages</code></p></td>
<td><p>number of pagination pages</p></td>
</tr>
<tr>
<td><p><code>previous_page</code></p></td>
<td><p>page number of the previous pagination page</p></td>
</tr>
<tr>
<td><p><code>previous_page_path</code></p></td>
<td><p>path (including leading "/") of previous pagination page</p></td>
</tr>
<tr>
<td><p><code>next_page</code></p></td>
<td><p>page number of the next pagination page</p></td>
</tr>
<tr>
<td><p><code>next_page_path</code></p></td>
<td><p>path (including leading "/") of next pagination page</p></td>
</tr>
</tbody>
</table>
<div class="note info"> <div class="note info">
<h5>Pagination does not support tags or categories</h5> <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 by a common tag or category.</p> <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 by a common tag or category.</p>