aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/categories/all.html
blob: 71b4bb6ed96d2f7c366d20c6c7c6ac3079ab32e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{% if site.posts.size == 0 %}
  <p>Sorry, no posts have been added yet.</p>
{% else %}
  {% for category in site.categories %}
    <h2><a class="category" href="{{ '/' | relative_url }}{{ category[0] | slugify: 'pretty' }}/">{{ category[0] }}</a></h2>
    <ul>
      {% for post in category[1] %}
        <li><a href="{{ post.url | relative_url }}">{{ post.date | date: "%Y-%m-%d" }} &mdash; {{ post.title }}</a></li>
      {% endfor %}
    </ul>
  {% endfor %}
  {% assign uncategorized = site.posts | where_exp: "post","post.categories.size == 0" %}
  {% if uncategorized.size != 0 %}
    <h2>Other</h2>
    <ul>
      {% for post in uncategorized %}
      <li><a href="{{ post.url | relative_url }}">{{ post.date | date: "%Y-%m-%d" }} &mdash; {{ post.title }}</a></li>
      {% endfor %}
    </ul>
  {% endif %}
{% endif %}