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
I have written a code snippet that not only shows post count in each category, but also navigates to the posts of a specific category which got clicked. I hope you find it helpful:
{% assign tags_list = site.categories %}
{% if tags_list.first[0] == null %}
{% for tag in tags_list %}
- {{ tag | capitalize }} {{ site.tags[tag].size }}
{% endfor %}
{% else %}
{% for tag in tags_list %}
- {{ tag[0] | capitalize }} {{ tag[1].size }}
{% endfor %}
{% endif %}
{% assign tags_list = nil %}
{% for tag in site.categories %}
{{ tag[0] | capitalize }}
{% assign pages_list = tag[1] %}
{% for post in pages_list %}
{% if post.title != null %}
{% if group == null or group == post.group %}
- {{ post.title }}
{% endif %}
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
{% endfor %}