Skip to content

Commit 9b03c22

Browse files
committed
docs: enhance param name
1 parent e022a2e commit 9b03c22

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/generators/web/ui/utils/sidebar.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { SIDEBAR_GROUPS } from '../../constants.mjs';
22

33
/**
44
* @deprecated This is being exported temporarily during the transition period.
5-
* Reverse lookup: filename (e.g. 'fs.html') groupName, used as category
5+
* Reverse lookup: filename (e.g. 'fs.html') -> groupName, used as category
66
* fallback for pages without explicit category in metadata.
77
*/
88
export const fileToGroup = new Map(
@@ -15,19 +15,16 @@ export const fileToGroup = new Map(
1515
* Builds grouped sidebar navigation from categorized page entries.
1616
* Pages without a category are placed under the provided default group.
1717
*
18-
* @param {Array<{ label: string, link: string, category?: string }>} frontmatter
18+
* @param {Array<{ label: string, link: string, category?: string }>} items
1919
* @param {string} [defaultGroupName='Others']
2020
* @returns {Array<{ groupName: string, items: Array<{ label: string, link: string }> }>}
2121
*/
22-
export const buildSideBarGroups = (
23-
frontmatter,
24-
defaultGroupName = 'Others'
25-
) => {
22+
export const buildSideBarGroups = (items, defaultGroupName = 'Others') => {
2623
const groups = new Map();
2724
const others = [];
2825

2926
// Group entries by category while preserving insertion order
30-
for (const { label, link, category } of frontmatter) {
27+
for (const { label, link, category } of items) {
3128
const linkFilename = link.split('/').at(-1);
3229

3330
// Skip index pages as they are typically the main entry point for a section

0 commit comments

Comments
 (0)