~xdavidwu/xdavidwu.link

ref: 6c0144ff2935eb19f35937a016721dcfdcad2b9c xdavidwu.link/example/_pages/category-archive.html -rwxr-xr-x 450 bytes
6c0144ff — Michael Rose Merge branch 'release/4.0.4' 8 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
layout: archive
permalink: /categories/
title: "Posts by Category"
author_profile: true
---

{% include base_path %}
{% include group-by-array collection=site.posts field="categories" %}

{% for category in group_names %}
  {% assign posts = group_items[forloop.index0] %}
  <h2 id="{{ category | slugify }}" class="archive__subtitle">{{ category }}</h2>
  {% for post in posts %}
    {% include archive-single.html %}
  {% endfor %}
{% endfor %}