From cf0461e90a3bf24bbf0b933021eab3f1265b3f30 Mon Sep 17 00:00:00 2001 From: Sean Doherty Date: Sun, 17 May 2026 01:05:51 -0500 Subject: [PATCH] dedupe tag filter options --- src/components/ProjectList.astro | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/ProjectList.astro b/src/components/ProjectList.astro index 8a8806b8..89ae6993 100644 --- a/src/components/ProjectList.astro +++ b/src/components/ProjectList.astro @@ -2,8 +2,19 @@ import ProjectCard from './ProjectCard.astro'; import { projectList } from '../data/projects.js'; -// Get all unique tags for filtering -const allTags = [...new Set(projectList.flatMap(project => project.tags || []))].sort(); +// Get all unique tag values for filtering, ignoring capitalization differences. +const allTags = [ + ...projectList + .flatMap(project => project.tags || []) + .reduce((tags, tag) => { + const key = tag.toLowerCase(); + if (!tags.has(key)) { + tags.set(key, tag); + } + return tags; + }, new Map()) + .values() +].sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' })); ---