Skip to content

Instantly share code, notes, and snippets.

View konstantin-morenko's full-sized avatar

Konstantin Morenko konstantin-morenko

View GitHub Profile
@konstantin-morenko
konstantin-morenko / list-categories-count.liquid
Last active January 21, 2021 14:49 — forked from Phlow/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category }}">{{ category | capitalize }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ tag[0] }}">{{ category[0] | capitalize }} ({{ category[1].size }})</a></li>