diff --git a/tabs/categories.md b/tabs/categories.md index b6c2382..fed6b98 100644 --- a/tabs/categories.md +++ b/tabs/categories.md @@ -11,6 +11,8 @@ title: Categories {% assign HEAD_PREFIX = "h_" %} {% assign LIST_PREFIX = "l_" %} +{% assign group_index = 0 %} + {% assign sort_categories = site.categories | sort %} {% for category in sort_categories %} @@ -36,47 +38,47 @@ title: Categories
+ id="{{ HEAD_PREFIX }}{{ group_index }}"> - {% if sub_categories_size > 0 %} - - {% else %} - - {% endif %} - - {{ category_name }} - + {% if sub_categories_size > 0 %} + + {% else %} + + {% endif %} + + {{ category_name }} + {% assign top_posts_size = site.categories[category_name] | size %} - + {% if sub_categories_size > 0 %} {{ sub_categories_size }} {% if sub_categories_size > 1 %}categories{% else %}category{% endif %}, {% endif %} {{ top_posts_size }} post{% if top_posts_size > 1 %}s{% endif %} - + {% if sub_categories_size > 0%} - - - + + + {% else %} - - - + + + {% endif %}
{% if sub_categories_size > 0 %} -
+
    {% for sub_category in sub_categories %}
  • @@ -95,5 +97,7 @@ title: Categories
+ {% assign group_index = group_index | plus: 1 %} + {% endif %} {% endfor %}