hacks-guide-minimal-mistake.../_pages/category-archive.md

1.2 KiB

layout permalink title
archive /category-archive/ Posts by Category

{% include absolute-url.liquid %} {% capture site_categories %}{% for category in site.categories %}{{ category | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %} {% assign category_list = site_categories | split:',' | sort %}

{% for item in (0..site.categories.size) %}{% unless forloop.last %} {% capture category_name %}{{ category_list[item] | strip_newlines }}{% endcapture %}

{{ category_name }}

{% for post in site.categories[category_name] %}{% if post.title != null %} {% endif %}{% endfor %} {% endunless %}{% endfor %}