Implemented archive page

This commit is contained in:
2023-08-09 01:02:29 +03:00
parent a9dbb38060
commit 4e4acb78af
5 changed files with 34 additions and 5 deletions
+1 -4
View File
@@ -6,13 +6,10 @@ genenerate_categories_pages = false
generate_tags_pages = false
generate_rss = true
feed_filename = "rss.xml"
minify_html = true
minify_html = false
taxonomies = [{ name = 'tags', feed = false }]
compile_sass = true
# Whether to build a search index to be used later on by a JavaScript library
build_search_index = true
[markdown]
highlight_code = true
highlight_theme = "gruvbox-dark"
+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 %}
+2
View File
@@ -6,6 +6,8 @@
⬡
<a href="/tags">Tags</a>
⬡
<a href="/archive">Archive</a>
⬡
<a href="/contact">Contact</a>
</nav>
<p>
+1 -1
View File
@@ -26,7 +26,7 @@
{% endblock meta %}
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="stylesheet" href="/site.css" />
<link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="shortcut icon" href="/favicon.ico" />
{% block links %}
<link rel="canonical" href="{{ section.permalink }}" />
{% endblock links %}