Skip to content

Instantly share code, notes, and snippets.

@tonyfast
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save tonyfast/6554aa89b7b60ded697e to your computer and use it in GitHub Desktop.

Select an option

Save tonyfast/6554aa89b7b60ded697e to your computer and use it in GitHub Desktop.
Easy solution to Jekyll /page1 when paginating
<!--
See http://jekyllrb.com/docs/pagination/#render-the-paginated-posts
for futher usage of pagination on Jekyll pages
-->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="previous">Previous</a>
{% else %}
<span class="previous">Previous</span>
{% endif %}
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="next">Next</a>
{% else %}
<span class="next ">Next</span>
{% endif %}
</div>
@tonyfast

Copy link
Copy Markdown
Author

Use {{ paginator.next_page_path }} instead of {{ paginator.next_page }} to build the paginated path.

Reference to problem

Jekyll Edge Case

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