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 {
14
14
context : string ,
15
15
levelLabel : string
16
16
) : 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 ( " " , "-" ) ;
21
18
22
19
//console.log("Creating level " + path);
23
20
const newPath = dirRoot + "/" + path ;
24
21
fs . mkdirSync ( newPath , { recursive : true } ) ;
25
- this . addCategoryMetadata ( newPath , order ) ;
22
+ this . addCategoryMetadata ( newPath , order , levelLabel ) ;
26
23
return path ;
27
24
}
28
25
@@ -60,8 +57,8 @@ export class HierarchicalNamedLayoutStrategy extends LayoutStrategy {
60
57
// "description": "This description can be used in the swizzled DocCard"
61
58
// }
62
59
// }
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 } " }` ;
65
62
fs . writeFileSync ( dir + "/_category_.json" , data ) ;
66
63
}
67
64
}
You can’t perform that action at this time.
0 commit comments