feat: add tags page

This commit is contained in:
Devin Haska 2024-02-06 23:00:46 -08:00
parent 6f6f79f11f
commit 210a278ab1
3 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,17 @@
.pill {
background-color: var(--color-bg-soft);
border-radius: 0.5rem;
}
.pill:hover {
background-color: var(--color-text);
color: var(--color-bg);
}
a.pill {
text-decoration: none;
}
.pill-count {
color: var(--color-text-soft);
}

View file

@ -0,0 +1,19 @@
---
title: All tags
permalink: /tags/index.html
layout: base
---
<section class="[ flow ]">
<h1>Tags</h1>
{% set categories = collections.categories | entries %}
<ol class="[ flex gap-1 list-none p-0 mb-0 ]">
{% for tag in categories %}
{% set key = tag | first %}
{% set count = tag | last %}
<li>
<a href="/tag/{{ key }}" class="[ pill ] [ px-1 py-0.5 ]">{{ key }} <span class="[ pill-count ]">{{ count }}</span></a>
</li>
{% endfor %}
</ol>
</section>

View file

@ -1,3 +1,9 @@
# Hello world
---
title: Hello world
date: 2017-01-01
categories:
- test
- email
---
This is a test post.