Skip to content

Commit 76e11a0

Browse files
committed
test improved docs
1 parent c2e1b7f commit 76e11a0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

scripts/add-frontmatter.mjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function prettify(str) {
3636
* @param {string} parent - Parent page title, if applicable
3737
* @param {boolean} isIndex - Whether the file is an index.md
3838
*/
39-
function addFrontmatter(filePath, navOrder, parent = "", isIndex = false) {
39+
function addFrontmatter(filePath, navOrder, parent = "") {
4040
const content = fs.readFileSync(filePath, "utf8");
4141

4242
// Skip files with existing frontmatter
@@ -59,8 +59,6 @@ function addFrontmatter(filePath, navOrder, parent = "", isIndex = false) {
5959
`title: ${title}`,
6060
parent ? `parent: ${parent}` : "",
6161
`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" : "",
6462
"---",
6563
"",
6664
].filter(Boolean);
@@ -152,8 +150,7 @@ function processDir(dir, startOrder = 1, parent = "") {
152150
const fullPath = path.join(dir, entry.name);
153151

154152
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);
157154
} else if (entry.isDirectory()) {
158155
// Root folders have no parent
159156
order = processDir(fullPath, order, isRoot ? "" : currentTitle);

0 commit comments

Comments
 (0)