{%- if page.type == 'categories' -%} {%- assign taxonomies = site.categories -%} {%- elsif page.type == 'tags' -%} {%- assign taxonomies = site.tags -%} {%- else -%} {%- assign taxonomies = none -%} {%- endif -%} {%- assign max_count = 0 -%} {%- for taxonomy in taxonomies -%} {%- assign posts = taxonomy[1] -%} {%- if posts.size > max_count -%} {%- assign max_count = posts.size -%} {%- endif -%} {%- endfor -%}
{%- 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] -%} {%- assign link = page.permalink -%} {%- if posts.size == i -%} {% capture anchor_url %}{{ link }}#{{ slugified_taxonomy_name }}{% endcapture %} {% if page.type == 'categories' %} {% assign taxonomy_name_list = taxonomy_name | split: ' ' %} {% capture capitalized_taxonomy_name %} {% for word in taxonomy_name_list %} {{ word | capitalize }} {% endfor %} {% endcapture %} {% endif %} {% if page.type == 'tags' %} {{ slugified_taxonomy_name }} {% else %} {{ capitalized_taxonomy_name }} {% endif %}    {{ posts.size }} {%- endif -%} {%- endfor -%} {%- endfor -%}
{%- 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 == 'categories' %} {% assign taxonomy_name_list = taxonomy_name | split: ' ' %} {% capture capitalized_taxonomy_name %} {% for word in taxonomy_name_list %} {{ word | capitalize }} {% endfor %} {% endcapture %} {% endif %}

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

{%- for post in posts -%}

» {{ post.title | escape }}

{%- endfor -%}
{%- endif -%} {%- endfor -%} {%- endfor -%}
{% if taxonomies.size == 0 %}

No categories to display yet.

{% endif %} {% include back-to-top.html %}