fix: move posts.html into src/pages

This commit is contained in:
Devin Haska 2024-03-23 18:35:30 -07:00
parent 559e0ec3de
commit 8eb736f8dd
2 changed files with 4 additions and 0 deletions

19
src/pages/posts.html Normal file
View file

@ -0,0 +1,19 @@
---
layout: "layouts/base"
permalink: /posts/index.html
title: Posts
---
{% from "macros/posts.njk" import yearList %}
<h1>All posts</h1>
<p>
Browse all of my posts, or narrow things down <a href="/tags">via tags</a>.
</p>
{% set itemsByYear = collections.post | reverse | organizeByDate %}
{% set years = itemsByYear | keys | sort("desc") %}
<section class="[ flow ]">
{% for year in years %}
{% set itemsInYear = itemsByYear[year] %}
{{ yearList(itemsInYear, year) }}
{% endfor %}
</section>