mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
---
|
|
// Cspell:words astro
|
|
import type { CollectionEntry } from 'astro:content';
|
|
type Journal = CollectionEntry<'journal'>;
|
|
import { getCollection } from 'astro:content';
|
|
|
|
import { animation } from '../data/site';
|
|
|
|
import GridLayout from '../layouts/GridLayout.astro';
|
|
import PageTitle from '../components/PageTitle.astro';
|
|
import TagComponent from '../components/Tag.astro';
|
|
|
|
const allJournal: Journal[] = await getCollection('journal', ({ data }: Journal) => !data.draft);
|
|
const uniqueTags = [...new Set(allJournal.map((entry) => entry.data.tags).flat())];
|
|
uniqueTags.sort((a, b) => a.localeCompare(b));
|
|
|
|
const title = 'Tags';
|
|
const description = 'This is a list of all the tags used in my journal.';
|
|
---
|
|
|
|
<GridLayout
|
|
backLink="/journal/"
|
|
class="grid"
|
|
description={description}
|
|
grid="wide"
|
|
innerGrid
|
|
title={title}
|
|
>
|
|
<PageTitle grid="wide" innerGrid>Tags</PageTitle>
|
|
<aside class="col-start-1 col-end-18 flex flex-wrap gap-y-3" {...animation}>
|
|
{uniqueTags.map((t) => <TagComponent href={`/tag/${t}/`}>{t}</TagComponent>)}
|
|
</aside>
|
|
</GridLayout>
|