feat: update posts page
This commit is contained in:
parent
2d4ff7b11c
commit
c4705a142c
2 changed files with 11 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
{% macro list(posts) %}
|
{% macro list(posts) %}
|
||||||
<ul class="[ list-none p-0 flow mt-1 mb-0 flow-space-0.25 ]">
|
<ul class="[ flow list-none m-0 p-0 flow-space-0.25 ]">
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<li class="[ flex flex-wrap column-gap-1 row-gap-0 ]">
|
<li class="[ flex flex-wrap column-gap-1 row-gap-0 ]">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -4,9 +4,17 @@ permalink: /posts/index.html
|
||||||
title: Posts
|
title: Posts
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% from "macros/posts.njk" import list %}
|
||||||
<h1>All posts</h1>
|
<h1>All posts</h1>
|
||||||
<p>
|
<p>
|
||||||
Browse all of my posts, or narrow things down <a href="/tags">via tags</a>.
|
Browse all of my posts, or narrow things down <a href="/tags">via tags</a>.
|
||||||
</p>
|
</p>
|
||||||
{% set items = collections.post | reverse %}
|
{% set itemsByYear = collections.post | reverse | organizeByDate %}
|
||||||
{% include "partials/archive.html" %}
|
{% set years = itemsByYear | keys | sort("desc") %}
|
||||||
|
<section class="[ flow ]">
|
||||||
|
{% for year in years %}
|
||||||
|
{% set itemsInYear = itemsByYear[year] %}
|
||||||
|
<h2>{{ year }}</h2>
|
||||||
|
<div class="[ items ] [ flex-col gap-0.25 ]">{{ list(itemsInYear) }}</div>
|
||||||
|
{% endfor %}
|
||||||
|
</section>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue