mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-30 06:22:16 +00:00
created archive page
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
sort_by = "date"
|
||||
template= "archive.html"
|
||||
+++
|
||||
@@ -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 %}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user