feat: add tags page
This commit is contained in:
parent
6f6f79f11f
commit
210a278ab1
3 changed files with 43 additions and 1 deletions
17
src/assets/css/blocks/pill.css
Normal file
17
src/assets/css/blocks/pill.css
Normal 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);
|
||||||
|
}
|
19
src/content/pages/tags.html
Normal file
19
src/content/pages/tags.html
Normal 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>
|
|
@ -1,3 +1,9 @@
|
||||||
# Hello world
|
---
|
||||||
|
title: Hello world
|
||||||
|
date: 2017-01-01
|
||||||
|
categories:
|
||||||
|
- test
|
||||||
|
- email
|
||||||
|
---
|
||||||
|
|
||||||
This is a test post.
|
This is a test post.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue