created archive page

This commit is contained in:
2025-01-17 00:02:28 +03:00
parent 1a45797ef6
commit 616f503bae
3 changed files with 33 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
+++
sort_by = "date"
template= "archive.html"
+++
+26
View File
@@ -0,0 +1,26 @@
{% extends "section.html" %}
{% block content %}
<main id="content">
<header>
<h1>Archive</h1>
</header>
{% set section = get_section(path="posts/_index.md") %}
{% for year, posts in section.pages
| sort(attribute="date")
| reverse
| group_by(attribute="year") %}
<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 %}
</main>
{% include "footer.html" %}
{% endblock content %}
+3
View File
@@ -5,7 +5,10 @@
<a href="/posts">Posts</a>
⬡
<a href="/tags">Tags</a>
⬡
<a href="/archive">Archive</a>
⬡
<a href="/contact">Contact</a>
</nav>
<p>