--- layout: page --- {{ content }} {% comment %} Check the type of archive {% endcomment %} {%- if page.type == 'categories' -%} {%- assign taxonomies = site.categories -%} {%- elsif page.type == 'tags' -%} {%- assign taxonomies = site.tags -%} {%- else -%} {%- assign taxonomies = none -%} {%- endif -%} {% comment %} Calculate the max count of taxonomies {% endcomment %} {%- assign max_count = 0 -%} {%- for taxonomy in taxonomies -%} {%- assign posts = taxonomy[1] -%} {%- if posts.size > max_count -%} {%- assign max_count = posts.size -%} {%- endif -%} {%- endfor -%}
{% comment %} Show posts by taxonomy {% endcomment %} {%- for i in (1..max_count) reversed -%} {%- for taxonomy in taxonomies -%} {%- assign taxonomy_name = taxonomy[0] -%} {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%} {%- assign posts = taxonomy[1] -%} {%- if posts.size == i -%}

{%- if page.type == 'tags' -%} {{ slugified_taxonomy_name }} {%- else -%} {{ taxonomy_name }} {%- endif -%}

Top ⇈ {%- endif -%} {%- endfor -%} {%- endfor -%}