Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/components/ProjectList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>())
.values()
].sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' }));
---

<div id="container">
Expand Down