{# Group the posts by year #}
{% set map = get_section(path="_index.md") | get(key="pages") | group_by(attribute="year") %}
- {% set_global years = [] %}
{# Convert the years map to an array (since maps do not have determined order) #}
- {% for year, ignored in map %}
- {% set_global years = years | concat(with=year) %}
- {% endfor %}
+ {% set_global years = [year for year, ignored in map] %}
{% for year in years | sort | reverse %}
{# Group the posts by year #}
{% set map = term.pages | group_by(attribute="year") %}
- {% set_global years = [] %}
{# Convert the years map to an array (since maps do not have determined order) #}
- {% for year, ignored in map %}
- {% set_global years = years | concat(with=year) %}
- {% endfor %}
+ {% set_global years = [year for year, ignored in map] %}