@@ -108,14 +108,17 @@ function getCategoryItems(outputDir, relativePath, generateLabel, generateDescri
108108 * @param {Array } items - Array of items to display
109109 * @returns {string } Generated MDX content
110110 */
111- function generateIndexMdxContent ( label , description , items ) {
111+ function generateIndexMdxContent ( label , description , items , hideFromSidebar = false ) {
112112 // Escape quotes in label and description for frontmatter
113113 const escapedLabel = label . replace ( / " / g, '\\"' ) ;
114114 const escapedDescription = description . replace ( / " / g, '\\"' ) ;
115115
116+ // Add sidebar_class_name: "hidden" to hide from sidebar if requested
117+ const sidebarClass = hideFromSidebar ? '\nsidebar_class_name: "hidden"' : '' ;
118+
116119 let mdxContent = `---
117120title: "${ escapedLabel } "
118- description: "${ escapedDescription } "
121+ description: "${ escapedDescription } "${ sidebarClass }
119122---
120123
121124import DocCard, { DocCardGrid } from '@site/src/components/docs/DocCard';
@@ -174,7 +177,8 @@ function createCategoryIndexFile(
174177 description ,
175178 generateLabel ,
176179 generateDescription ,
177- overwrite = false
180+ overwrite = false ,
181+ hideFromSidebar = false
178182) {
179183 const indexFile = path . join ( outputDir , 'index.mdx' ) ;
180184
@@ -187,7 +191,7 @@ function createCategoryIndexFile(
187191 const items = getCategoryItems ( outputDir , relativePath , generateLabel , generateDescription ) ;
188192
189193 // Generate MDX content
190- const mdxContent = generateIndexMdxContent ( label , description , items ) ;
194+ const mdxContent = generateIndexMdxContent ( label , description , items , hideFromSidebar ) ;
191195
192196 // Ensure directory exists
193197 fs . mkdirSync ( outputDir , { recursive : true } ) ;
0 commit comments