File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { 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
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments