File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,12 @@ export class HierarchicalNamedLayoutStrategy extends LayoutStrategy {
1414 context : string ,
1515 levelLabel : string
1616 ) : string {
17- // The docusaurus documentation doesn't specify how the prefix should look (such that it recognizes and strips it)
18- // A following dash works.
19- const prefix = "" ;
20- const path = context + "/" + prefix + sanitize ( levelLabel ) ; //.replaceAll(" ", "-");
17+ const path = context + "/" + sanitize ( levelLabel ) . replaceAll ( " " , "-" ) ;
2118
2219 //console.log("Creating level " + path);
2320 const newPath = dirRoot + "/" + path ;
2421 fs . mkdirSync ( newPath , { recursive : true } ) ;
25- this . addCategoryMetadata ( newPath , order ) ;
22+ this . addCategoryMetadata ( newPath , order , levelLabel ) ;
2623 return path ;
2724 }
2825
@@ -60,8 +57,8 @@ export class HierarchicalNamedLayoutStrategy extends LayoutStrategy {
6057 // "description": "This description can be used in the swizzled DocCard"
6158 // }
6259 // }
63- private addCategoryMetadata ( dir : string , order : number ) {
64- const data = `{"position":${ order } }` ;
60+ private addCategoryMetadata ( dir : string , order : number , label : string ) {
61+ const data = `{"position":${ order } , "label":" ${ label } " }` ;
6562 fs . writeFileSync ( dir + "/_category_.json" , data ) ;
6663 }
6764}
You can’t perform that action at this time.
0 commit comments