Добавлено разбиение заметок по годам
This commit is contained in:
parent
a0aba1e38c
commit
8d0cabf6fb
@ -8,8 +8,20 @@ use: [articles]
|
||||
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
<ul>
|
||||
{% for year in 2010..2030 %}
|
||||
|
||||
{% set items = [] %}
|
||||
|
||||
{% for article in data.articles %}
|
||||
{% if article.date|date('Y') == year %}
|
||||
{% set items = items|merge([article]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if items %}
|
||||
<h2>{{ year }}</h2>
|
||||
<ul>
|
||||
{% for article in items %}
|
||||
<li>
|
||||
<p>
|
||||
<a href="{{ article.url }}">{{ article.title }}</a>
|
||||
@ -21,5 +33,8 @@ use: [articles]
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user