index.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. layout: in-pagebody
  3. title: News
  4. ---
  5. {% for post in paginator.posts %}
  6. <section class="news">
  7. <div class="datestamp">
  8. <p>{{ post.date | date: "%b %-d, %Y" }}</p>
  9. </div>
  10. <h2><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
  11. {{ post.content }}
  12. </section>
  13. <hr/>
  14. {% endfor %}
  15. {% if paginator.total_pages > 1 %}
  16. <div class="pagination">
  17. {% if paginator.previous_page %}
  18. <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Previous</a>
  19. {% else %}
  20. <span>&laquo; Previous</span>
  21. {% endif %}
  22. {% for page in (1..paginator.total_pages) %}
  23. {% if page == paginator.page %}
  24. <em>{{ page }}</em>
  25. {% elsif page == 1 %}
  26. <a href="{{ site.paginate_path | prepend: site.baseurl | replace: ':num', '' | replace: '//', '/' }}">{{ page }}</a>
  27. {% else %}
  28. <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
  29. {% endif %}
  30. {% endfor %}
  31. {% if paginator.next_page %}
  32. <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
  33. {% else %}
  34. <span>Next &raquo;</span>
  35. {% endif %}
  36. </div>
  37. {% endif %}