Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 1.06 KB

post_by_categories.md

File metadata and controls

37 lines (32 loc) · 1.06 KB
layout title permalink sidebar
archive
Posts by Categories
/categories/
nav
docs

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.

Posts by categories

{% 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 %}

{{ t }}

    {% for post in posts %} {% if post.categories contains t %}
  • {{ post.date | date: '%d %b %y' }}: {{ post.title }}
  • {% endif %} {% endfor %}
{% endfor %}