feat: add catalogue page
This commit is contained in:
parent
26f802ef28
commit
4e0c778025
8 changed files with 32 additions and 28 deletions
17
src/_includes/partials/archive.html
Normal file
17
src/_includes/partials/archive.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% set itemsByYear = items | organizeByDate %}
|
||||
{% set years = itemsByYear | keys | sort("desc") %}
|
||||
<section>
|
||||
{% for year in years %}
|
||||
{% set itemsInYear = itemsByYear[year] %}
|
||||
<div class="[ flex ]">
|
||||
<h2>{{ year }}</h2>
|
||||
</div>
|
||||
{% for item in itemsInYear %}
|
||||
<div class="[ flex items-center justify-between ]">
|
||||
<a href="{{ item.url }}">{{ item.data.title }}</a>
|
||||
<div class="[ archive-divider ] [ mx-0.5 ]"></div>
|
||||
<div>{{ item.date | formatDate("MM/DD") }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</section>
|
|
@ -1,16 +0,0 @@
|
|||
<section>
|
||||
{% for year, postsByYear in posts %}
|
||||
<div class="[ flex ]">
|
||||
<h2>{{ year }}</h2>
|
||||
</div>
|
||||
{% for month, postsByMonth in postsByYear %}
|
||||
{% for post in postsByMonth %}
|
||||
<div class="[ flex items-center justify-between ]">
|
||||
<a href="{{ post.url }}">{{ post.data.title }}</a>
|
||||
<div class="[ archive-divider ] [ mx-0.5 ]"></div>
|
||||
<div>{{ post.date | formatDate("MM/DD") }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</section>
|
Loading…
Add table
Add a link
Reference in a new issue