---
layout: default
---

<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
  <article class="post">    
      <h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
      <div class="entry">
        {{ post.content | truncatewords:20}}
      </div>      
      <a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
    </article>
{% endfor %}
<p>
<!-- Pagination links -->
<div class="pagination">
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
  {% if paginator.previous_page %}
    {% if paginator.page != 2 %}
      | <a href="/page{{ paginator.previous_page }}" class="previous">Previous</a>     
    {% else %}
    | <a href="/" class="previous">Previous</a>
    {% endif %}
  {% endif %}
  {% if paginator.next_page %}
    | <a href="/page{{ paginator.next_page }}" class="">Next</a>
  {% else %}
    <span class="next ">Next</span>
  {% endif %}
  | <a href="/allposts">List all posts</a>
</div>
</p>
---
layout: default
---

<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
  <article class="post">    
      <h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
      <div class="entry">
        {{ post.content | truncatewords:20}}
      </div>      
      <a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
    </article>
{% endfor %}
<p>
<!-- Pagination links -->
<div class="pagination">
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
  {% if paginator.previous_page %}
    {% if paginator.page != 2 %}
      | <a href="/page{{ paginator.previous_page }}" class="previous">Previous</a>     
    {% else %}
    <a href="/" class="previous">Previous</a>
    {% endif %}
    {% else %}
    <span class="next ">Previous</span>
  {% endif %}
  {% if paginator.next_page %}
    | <a href="/page{{ paginator.next_page }}" class="">Next</a>
  {% else %}
    | <span class="next ">Next</span>
  {% endif %}
  <span class="page_number ">[ Page: {{ paginator.page }} of {{ paginator.total_pages }} ]</span>
  <a href="/allposts">List all posts</a>
</div>
</p>
Change order of pagination links
Change order of pagination links
