---
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 | truncate: 3 }}</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 %}

---
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.content | truncate: 30 }}</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 %}

Test long truncation with content
Test long truncation with content