posts-index.html 1.19 KB
Newer Older
Anna Wilson's avatar
Anna Wilson committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
---
layout: single
title: Posts
pagination:
  enabled: true
permalink: /posts/
---
{% for post in paginator.posts %}
  <p>
  <strong><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></strong><br>
  
  Posted
  {% for cat in post.categories %}
    {% if forloop.first %}in <b>{% endif %}{{ cat }}</a>{% unless forloop.last %}, {% endunless %}
  {% endfor %}
  </b> on  {{ post.date | date:"%Y-%m-%d" }}<br>
  
  {% for tag in post.tags %}
    <a href="{{ site.baseurl }}/posts/tags/{{ tag }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
  {% endfor %}
  </p>
{% endfor %}

{% if paginator.page_trail %}
<div class="pagination">
  {% if paginator.previous_page %}
      <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&lt;&lt;</a>
  {% endif %}
  {% for trail in paginator.page_trail %}
        <a href="{{ trail.path | prepend: site.baseurl }}" title="{{trail.title}}"
        {% if page.url == trail.path %}class="active"{% endif %}
        >{{ trail.num }}</a>
  {% endfor %}
  {% if paginator.next_page %}
      <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">&gt;&gt;</a>
  {% endif %}
</div>
{% endif %}