Skip to content

Commit 67c54d6

Browse files
committed
refactor: remove static group array
1 parent 52e939c commit 67c54d6

2 files changed

Lines changed: 3 additions & 140 deletions

File tree

src/generators/web/ui/components/SideBar/utils/index.mjs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
import { relative } from '../../../../../../utils/url.mjs';
2-
import { SIDEBAR_GROUPS } from '../../../constants.mjs';
3-
4-
/**
5-
* @deprecated This is being exported temporarily during the transition period.
6-
* Reverse lookup: filename (e.g. 'fs.html') -> groupName, used as category
7-
* fallback for pages without explicit category in metadata.
8-
*/
9-
export const fileToGroup = new Map(
10-
SIDEBAR_GROUPS.flatMap(({ groupName, items }) =>
11-
items.map(item => [item, groupName])
12-
)
13-
);
142

153
/**
164
* Builds grouped sidebar navigation from categorized page entries.
@@ -40,16 +28,14 @@ export const buildSideBarGroups = (
4028
continue;
4129
}
4230

43-
const resolvedCategory = category ?? fileToGroup.get(linkFilename);
44-
45-
if (!resolvedCategory) {
31+
if (!category) {
4632
others.push({ label, link });
4733
continue;
4834
}
4935

50-
const groupItems = groups.get(resolvedCategory) ?? [];
36+
const groupItems = groups.get(category) ?? [];
5137
groupItems.push({ label, link });
52-
groups.set(resolvedCategory, groupItems);
38+
groups.set(category, groupItems);
5339
}
5440

5541
// Convert the groups map to an array while preserving the original order of categories

src/generators/web/ui/constants.mjs

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)