You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

blog.html 986B

123456789101112131415161718192021222324252627282930313233
  1. ---
  2. title: Blog
  3. pagination:
  4. enabled: true
  5. ---
  6. {% for post in paginator.posts %}
  7. <h2><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h2>
  8. <p class="post-metadata">Published on {{ post.date | date: "%b %-d, %Y" }}</p>
  9. {{ post.content }}
  10. {% endfor %}
  11. {% if paginator.total_pages > 1 %}
  12. <ul class="pagination">
  13. {% if paginator.previous_page %}
  14. <li><a href="{{ paginator.previous_page_path | relative_url }}">&laquo; Prev</a>
  15. {% endif %}
  16. {% for page in (1..paginator.total_pages) %}
  17. {% if page == paginator.page %}
  18. <li>{{ page }}</li>
  19. {% elsif page == 1 %}
  20. <li><a href="{{ paginator.previous_page_path | relative_url }}">{{ page }}</a></li>
  21. {% else %}
  22. <li><a href="{{ site.paginate_path | relative_url | replace: ':num', page }}">{{ page }}</a></li>
  23. {% endif %}
  24. {% endfor %}
  25. {% if paginator.next_page %}
  26. <li><a href="{{ paginator.next_page_path | relative_url }}">Next &raquo;</a></li>
  27. {% endif %}
  28. </ul>
  29. {% endif %}