From 4295d8f4a971828bd52206851058ef3ea18f5389 Mon Sep 17 00:00:00 2001
From: Oliver Bryan <04oliverbryan@gmail.com>
Date: Tue, 30 Sep 2025 16:33:56 +0100
Subject: [PATCH] tag filters
---
src/components/ProjectListItem.astro | 2 +-
src/pages/index.astro | 108 +++++++++++++++++++++++++++
2 files changed, 109 insertions(+), 1 deletion(-)
diff --git a/src/components/ProjectListItem.astro b/src/components/ProjectListItem.astro
index 513aaec5..6fc2da76 100644
--- a/src/components/ProjectListItem.astro
+++ b/src/components/ProjectListItem.astro
@@ -74,7 +74,7 @@ tags.sort();
tags && tags.length > 0 && (
{tags.map((tag: string, idx: number) => (
-
+
{tag}
))}
diff --git a/src/pages/index.astro b/src/pages/index.astro
index abe3cb83..e05d83c6 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -71,6 +71,13 @@ const projects: ProjectMetadata[] = Object.values(
.filter((metadata): metadata is ProjectMetadata => metadata !== undefined)
.filter((project) => !project.hidden || isDevMode)
.sort((a, b) => parseDate(b.date).getTime() - parseDate(a.date).getTime());
+
+const allTags = new Set();
+projects.forEach((project) => {
+ project.tags?.forEach((tag) => allTags.add(tag));
+});
+
+const sortedTags = Array.from(allTags).sort((a, b) => a.localeCompare(b));
---