Skip to content

Commit 9aed226

Browse files
committed
No need to add links as ToC is auto added by just-the-docs
1 parent 5e01cb6 commit 9aed226

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

scripts/add-frontmatter.mjs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ function ensureIndexMd(dir, navOrder, parent = "") {
8282
if (!fs.existsSync(indexPath) && !isRoot) {
8383
const title = prettify(path.basename(dir));
8484

85-
const entries = fs.readdirSync(dir, { withFileTypes: true });
86-
87-
const fileLinks = entries
88-
.filter(e => e.isFile() && e.name.endsWith(".md") && e.name.toLowerCase() !== "index.md")
89-
.map(e => `- [${prettify(path.basename(e.name, ".md"))}](${e.name})`);
90-
91-
const folderLinks = entries
92-
.filter(e => e.isDirectory())
93-
.map(e => `- [${prettify(e.name)}](${e.name}/)`);
94-
95-
const links = [...fileLinks, ...folderLinks].join("\n");
96-
9785
const fmLines = [
9886
"---",
9987
"layout: default",
@@ -105,7 +93,6 @@ function ensureIndexMd(dir, navOrder, parent = "") {
10593
"",
10694
`# ${title}`,
10795
"",
108-
links || "_No pages yet._",
10996
].filter(Boolean);
11097

11198
fs.writeFileSync(indexPath, fmLines.join("\n"), "utf8");

0 commit comments

Comments
 (0)