Skip to content

Commit 10ee6dd

Browse files
authored
feat(projects): sort projects alphabetically within each category (#36)
1 parent 94aead0 commit 10ee6dd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/lib/projects.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export function groupByCategory(projects: Project[], order: string[]): CategoryG
2424
byCategory.set(project.category, list);
2525
}
2626

27+
// Sort each category's projects alphabetically by name (case-insensitive).
28+
for (const list of byCategory.values()) {
29+
list.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: "base" }));
30+
}
31+
2732
const groups: CategoryGroup[] = [];
2833
const seen = new Set<string>();
2934
for (const category of order) {

0 commit comments

Comments
 (0)