Jekyll & Liquid: Output category list with post count?

前端 未结 3 1805
逝去的感伤
逝去的感伤 2021-02-01 07:42

I\'m somehow stuck and don\'t find the right way to do it.

I want to output a category list with the number of posts in each categorie.

I got this far: https://p

3条回答
  •  伪装坚强ぢ
    2021-02-01 08:09

    An incremental improvement over Hossain's answer, which sorts the categories. Tested with Jekyll 3.3.1:

    Blog Posts Sorted By Category

    {% assign sorted_categories = site.categories | sort %} {% for tag in sorted_categories %}

    {{ tag[0] | capitalize }}

    {% endfor %}

提交回复
热议问题