docs: use YAML data for paginator obkect

This commit is contained in:
Frank Taillandier 2018-10-26 15:00:17 +02:00
parent 9ff6a24a06
commit bc11acc7b1
No known key found for this signature in database
GPG Key ID: E73258E3F50AEB7E
2 changed files with 23 additions and 81 deletions

View File

@ -1,3 +1,8 @@
# Variables provided by Jekyll core
#
# name: : name of the variable
# description: : content returned by the varialble
global:
- name: site
description: >-
@ -133,21 +138,25 @@ page:
Returns <code>nil</code> for the first entry.
paginator:
- name: paginator.per_page
description: Number of Posts per page.
- name: paginator.posts
description: Posts available for that page.
- name: paginator.total_posts
description: Total number of Posts.
- name: paginator.total_pages
description: Total number of pages.
- name: paginator.page
description: The number of the current page.
description: The number of the current page
- name: paginator.per_page
description: Number of posts per page
- name: paginator.posts
description: Posts available for the current page
- name: paginator.total_posts
description: Total number of posts
- name: paginator.total_pages
description: Total number of pages
- name: paginator.previous_page
description: The number of the previous page.
description: >-
The number of the previous page, , or <code>nil</code> if no previous page exists
- name: paginator.previous_page_path
description: The path to the previous page.
description: >-
The path to the previous page, or <code>nil</code> if no previous page exists
- name: paginator.next_page
description: The number of the next page.
description: >-
The number of the next page, , or <code>nil</code> if no subsequent page exists
- name: paginator.next_page_path
description: The path to the next page.
description: >-
The path to the next page, or <code>nil</code> if no subsequent page exists

View File

@ -71,74 +71,7 @@ with the first 5 posts, `blog/page2/index.html` with the next 5 posts and
The pagination plugin exposes the `paginator` liquid object with the following
attributes:
<div class="mobile-side-scroller">
<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,
or <code>nil</code> if no previous page exists
</p>
</td>
</tr>
<tr>
<td><p><code>previous_page_path</code></p></td>
<td>
<p>
path of previous pagination page,
or <code>nil</code> if no previous page exists
</p>
</td>
</tr>
<tr>
<td><p><code>next_page</code></p></td>
<td>
<p>
page number of the next pagination page,
or <code>nil</code> if no subsequent page exists
</p>
</td>
</tr>
<tr>
<td><p><code>next_page_path</code></p></td>
<td>
<p>
path of next pagination page,
or <code>nil</code> if no subsequent page exists
</p>
</td>
</tr>
</tbody>
</table>
</div>
{% include docs_variables_table.html scope=site.data.jekyll_variables.paginator %}
<div class="note info">
<h5>Pagination does not support tags or categories</h5>