feat: update catalogue to work with tags
This commit is contained in:
parent
327b38f35b
commit
87deddd544
7 changed files with 48 additions and 8 deletions
21
src/_includes/partials/catalogue.html
Normal file
21
src/_includes/partials/catalogue.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
{% set itemsByYear = items | organizeByDate %}
|
||||
{% set years = itemsByYear | keys | sort("desc") %}
|
||||
<section class="[ archive ]">
|
||||
{% for year in years %}
|
||||
{% set itemsInYear = itemsByYear[year] %}
|
||||
<div class="[ flex mt-1.5 mb-0.5 ]">
|
||||
<h2>{{ year }}</h2>
|
||||
</div>
|
||||
<div class="[ items ] [ flex-col gap-0.25 ]">
|
||||
{% for item in itemsInYear %}
|
||||
{% set type = item.data.tags[1] %}
|
||||
<div class="[ flex items-center justify-between ]">
|
||||
<a href="{{ item.url }}">{{ item.data.title }}</a>
|
||||
<hr class="[ archive-divider ] [ mx-0.5 ]" />
|
||||
<p class="[ px-0.5 ]">{{ type }}</p>
|
||||
<p class="[ archive-date ]">{{ item.date | formatDate("MM/DD") }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"layout": "catalogue",
|
||||
"tags": "games",
|
||||
"tags": "game",
|
||||
"permalink": "games/{{ page.fileSlug }}/index.html"
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@ permalink: /catalogue/index.html
|
|||
title: Catalogue
|
||||
---
|
||||
|
||||
<h1>Catalogue yo</h1>
|
||||
{% for item in collections.catalogue %}{{ item.data.tags | dump }}{% endfor %}
|
||||
<h1>Catalogue</h1>
|
||||
{% set items = collections.catalogue %}
|
||||
{% include "partials/catalogue.html" %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue