layout | title | permalink | sidebar | ||
---|---|---|---|---|---|
archive |
Posts by Categories |
/categories/ |
|
This page displays the site's categories in alphabetical order and shows how many posts there are per tag, makes anchor links for each tag, then outputs posts by tag in reverse chronological order.
{% assign sorted_cat = (site.categories | sort:0) %}
-
{% for cat in sorted_cat %}
{% assign t = cat | first %}
{% assign posts = cat | last %}
- {{ t }} ({{ posts.size }}) {% endfor %}
{% for cat in sorted_cat %} {% assign t = cat | first %} {% assign posts = cat | last %}
-
{% for post in posts %}
{% if post.categories contains t %}
- {{ post.date | date: '%d %b %y' }}: {{ post.title }} {% endif %} {% endfor %}