Skip to content

Commit 588bc5c

Browse files
committed
test improved docs
1 parent 22cf962 commit 588bc5c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

scripts/add-frontmatter.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ function addFrontmatter(filePath, navOrder, parent = "", isIndex = false) {
4848
if (filePath === path.join(DOCS_DIR, "index.md")) {
4949
// Root index.md → Home page
5050
title = "Home";
51-
} else if (isIndex) {
52-
// Folder's index page → folder name
53-
title = prettify(path.basename(path.dirname(filePath)));
5451
} else {
5552
// Regular file → file name
5653
title = prettify(baseName);
@@ -155,7 +152,7 @@ function processDir(dir, startOrder = 1, parent = "") {
155152
const fullPath = path.join(dir, entry.name);
156153

157154
if (entry.isFile() && entry.name.endsWith(".md")) {
158-
const isIndex = entry.name.toLowerCase() === "index.md";
155+
const isIndex = entry.name.toLowerCase() === "readme.md";
159156
addFrontmatter(fullPath, order++, isRoot ? "" : isIndex ? parent : currentTitle, isIndex);
160157
} else if (entry.isDirectory()) {
161158
// Root folders have no parent
@@ -167,7 +164,7 @@ function processDir(dir, startOrder = 1, parent = "") {
167164
}
168165

169166
const ModuleTitle = "\n## Modules\n";
170-
const rootMdFile = path.resolve(DOCS_DIR, "index.md");
167+
const rootMdFile = path.resolve(DOCS_DIR, "README.md");
171168
let [staticPart, moduleIndex] = fs.readFileSync(rootMdFile, "utf8").split(ModuleTitle);
172169

173170
function flattenDirs(dir, parent = "") {
@@ -203,6 +200,7 @@ function flattenDirs(dir, parent = "") {
203200
// flatten docs output
204201
flattenDirs(DOCS_DIR);
205202
fs.writeFileSync(rootMdFile, [staticPart, moduleIndex].join(ModuleTitle));
203+
fs.renameSync(path.resolve(DOCS_DIR, "README.md"), path.resolve(DOCS_DIR, "index.md"));
206204

207205
// Run script
208206
processDir(DOCS_DIR);

typedoc.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module.exports = {
2020
prettierConfigFile: "./.prettierrc",
2121
sanitizeComments: true,
2222
router: "module",
23-
entryFileName: "index",
2423
mergeReadme: true,
2524
hideBreadcrumbs: true,
2625
expandParameters: true,

0 commit comments

Comments
 (0)