Skip to content

Commit f2cbff3

Browse files
committed
listings - sort categories case-insensitively
1 parent 6661062 commit f2cbff3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/project/types/website/listing/website-listing-categories.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* website-listing-categories.ts
33
*
4-
* Copyright (C) 2020-2022 Posit Software, PBC
4+
* Copyright (C) 2020-2025 Posit Software, PBC
55
*/
66
import { Document } from "deno_dom/deno-dom-wasm-noinit.ts";
77
import {
@@ -72,7 +72,12 @@ export function categorySidebar(
7272
categoriesEl.appendChild(allEl);
7373
}
7474

75-
for (const cat of Object.keys(cats).sort()) {
75+
console.log("HERE");
76+
for (
77+
const cat of Object.keys(cats).sort((a: string, b: string) =>
78+
a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())
79+
)
80+
) {
7681
const count = cats[cat];
7782
const catEl = categoryElement(doc, cat, formatFn(cat, count), cat);
7883
categoriesEl.appendChild(catEl);

0 commit comments

Comments
 (0)