completed archive feature

This commit is contained in:
2023-08-08 12:40:15 +03:00
parent ca39f4f4fe
commit c005ab3263
13 changed files with 776 additions and 12 deletions
+15 -8
View File
@@ -1,9 +1,16 @@
{% for year, posts in section.pages | group_by(attribute="year") %}
<h2>{{ year }}</h2>
{% extends 'base.html' %} {% block content %} {% set section=
get_section(path="blog/_index.md")%} {% for year,posts in section.pages |
sort(attribute="date") | reverse | group_by(attribute="year")%}
<ul>
{% for post in posts %}
<li><a href="{{ post.permalink }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
<div class="archive">
<h2>{{ year }}</h2>
<ul>
{% for post in posts %}
<li>
<time> {{post.date | date(format="%d-%h")}} </time>
<a href="{{ post.permalink }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endfor %} {% endblock content %}