parent
c4e5a65908
commit
2c8a21d558
@ -25,7 +25,16 @@
|
|||||||
{%- set_global all_posts = all_posts | concat(with=section_item.pages) -%}
|
{%- set_global all_posts = all_posts | concat(with=section_item.pages) -%}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{% for year, posts in all_posts | group_by(attribute="year") %}
|
{# Group posts by year. #}
|
||||||
|
{% set posts_by_year = all_posts | group_by(attribute="year") %}
|
||||||
|
{% set years = [] %}
|
||||||
|
{% for year, ignored in posts_by_year %}
|
||||||
|
{% set_global years = years | concat(with=[year]) %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{# Iterate over sorted & reversed years (newest to oldest). #}
|
||||||
|
{% for year in years | sort | reverse %}
|
||||||
|
{% set posts = posts_by_year[year] %}
|
||||||
{% if posts | length > 0 %}
|
{% if posts | length > 0 %}
|
||||||
<li>
|
<li>
|
||||||
<h2 class="listing-title">{{ year }}</h2>
|
<h2 class="listing-title">{{ year }}</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user