@@ -36,7 +36,7 @@ function prettify(str) {
36
36
* @param {string } parent - Parent page title, if applicable
37
37
* @param {boolean } isIndex - Whether the file is an index.md
38
38
*/
39
- function addFrontmatter ( filePath , navOrder , parent = "" , isIndex = false ) {
39
+ function addFrontmatter ( filePath , navOrder , parent = "" ) {
40
40
const content = fs . readFileSync ( filePath , "utf8" ) ;
41
41
42
42
// Skip files with existing frontmatter
@@ -59,8 +59,6 @@ function addFrontmatter(filePath, navOrder, parent = "", isIndex = false) {
59
59
`title: ${ title } ` ,
60
60
parent ? `parent: ${ parent } ` : "" ,
61
61
`nav_order: ${ navOrder } ` ,
62
- // has_children only if it's not root index
63
- isIndex && filePath !== path . join ( DOCS_DIR , "index.md" ) ? "has_children: true" : "" ,
64
62
"---" ,
65
63
"" ,
66
64
] . filter ( Boolean ) ;
@@ -152,8 +150,7 @@ function processDir(dir, startOrder = 1, parent = "") {
152
150
const fullPath = path . join ( dir , entry . name ) ;
153
151
154
152
if ( entry . isFile ( ) && entry . name . endsWith ( ".md" ) ) {
155
- const isIndex = entry . name . toLowerCase ( ) === "readme.md" ;
156
- addFrontmatter ( fullPath , order ++ , isRoot ? "" : isIndex ? parent : currentTitle , isIndex ) ;
153
+ addFrontmatter ( fullPath , order ++ , isRoot ? "" : currentTitle ) ;
157
154
} else if ( entry . isDirectory ( ) ) {
158
155
// Root folders have no parent
159
156
order = processDir ( fullPath , order , isRoot ? "" : currentTitle ) ;
0 commit comments