{%- if site.index %} {# custom index page #}
{{ page.content }}
{%- else %} {# auto generate index page #}
{%- for category in pages %}
{%- if site.default_ext not in category %} {# is category #}
{%- if 'label' in category %}{{ category.label }}
{%- else %}{{ category.name|capitalize }}{% endif %}
{%- for page in category.pages %}
{%- if site.default_ext in page.fname %} {# is page #}
{{ page.title }}
{%- if 'description' in page %}
{{ page.description }}
{% endif %}
{%- elif 'pages' in page %} {# is collection #}
{% set coll = page %} {# for readability #}
{{ coll.name }} :
{%- for coll_page in coll.pages %}
{{ coll_page.title }}
{%- if 'description' in coll_page %}
{{ coll_page.description }}
{% endif %}
{%- if not loop.last %} / {% endif %}
{%- endfor %}
{%- endif %}