---
layout: page
title:
permalink: /posts/
---

{% for category in site.categories %}
  <h4>{{ category | first }}</h4>
    <ul>
    {% for posts in category %}
      {% for post in posts reversed %}
        {% if post.url %}<li><a href="{{ post.url }}">{{ post.title }}</a></li>{% endif %}
      {% endfor %}
    {% endfor %}
    </ul>
{% endfor %}

{% for post in site.posts %}
  {% assign currentdate = post.date | date: "%Y" %}
  {% if currentdate != date %}
    {% unless forloop.first %}</ul>{% endunless %}
    <h4 id="y{{post.date | date: "%Y"}}">{{ currentdate }}</h4>
    <ul>
    {% assign date = currentdate %}
  {% endif %}
    <li><span class="post-list-date">{{ post.date | date: '%B %d, %Y' }}</span><a class="post-list" href="{{ post.url }}">{{ post.title }}</a></li>
  {% if forloop.last %}</ul>{% endif %}
{% endfor %}
---
layout: page
title:
permalink: /posts/
---

<h2>Posts by Category</h2>
{% for category in site.categories %}
  <h4>{{ category | first }}</h4>
    <ul>
    {% for posts in category %}
      {% for post in posts reversed %}
        {% if post.url %}<li><a href="{{ post.url }}">{{ post.title }}</a></li>{% endif %}
      {% endfor %}
    {% endfor %}
    </ul>
{% endfor %}

<br>

<h2>Posts by Date</h2>

{% for post in site.posts %}
  {% assign currentdate = post.date | date: "%Y" %}
  {% if currentdate != date %}
    {% unless forloop.first %}</ul>{% endunless %}
    <h4 id="y{{post.date | date: "%Y"}}">{{ currentdate }}</h4>
    <ul>
    {% assign date = currentdate %}
  {% endif %}
    <li><span class="post-list-date">{{ post.date | date: '%B %d, %Y' }}</span><a class="post-list" href="{{ post.url }}">{{ post.title }}</a></li>
  {% if forloop.last %}</ul>{% endif %}
{% endfor %}

Add section titles to Posts page
Add section titles to Posts page

Posts by category and posts by date ran together. This led to many posts 
appearing twice. Adding section names and a bit of white space makes 
this distinction clear.
