Skip to content

Commit b09d91e

Browse files
dawnhoclaude
andcommitted
fix: use index.mdx instead of README.mdx for clean URLs
Rename README.mdx → index.mdx (127 files) so Mintlify serves directory pages at clean paths like /core-concepts/devices instead of /core-concepts/devices/README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 247b670 commit b09d91e

129 files changed

Lines changed: 132 additions & 134 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

migrate-to-mintlify.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ function parseSummary(summaryPath, spacePrefix) {
387387
if (pagePath.startsWith("http")) continue;
388388
if (pagePath.includes("broken-reference") || pagePath.includes("/broken/")) continue;
389389

390-
// Strip .md extension (Mintlify uses .mdx, referenced without extension)
391-
pagePath = pagePath.replace(/\.md$/, "");
390+
// Strip .md extension and README (use index instead)
391+
pagePath = pagePath.replace(/\.md$/, "").replace(/\/README$/, "").replace(/^README$/, "index");
392392

393393
// Prefix with space name
394394
pagePath = spacePrefix ? `${spacePrefix}/${pagePath}` : pagePath;
@@ -429,7 +429,7 @@ function parseSummaryAsGroups(summaryPath, spacePrefix) {
429429
if (pagePath.startsWith("http")) continue;
430430
if (pagePath.includes("broken-reference") || pagePath.includes("/broken/")) continue;
431431

432-
pagePath = pagePath.replace(/\.md$/, "");
432+
pagePath = pagePath.replace(/\.md$/, "").replace(/\/README$/, "").replace(/^README$/, "index");
433433
pagePath = spacePrefix ? `${spacePrefix}/${pagePath}` : pagePath;
434434

435435
items.push({ title, path: pagePath, indent });
@@ -601,10 +601,8 @@ function main() {
601601
const content = fs.readFileSync(srcPath, "utf-8");
602602
const relativePath = path.relative(SRC, srcPath);
603603

604-
const destFile = path.join(
605-
destDir,
606-
entry.replace(/\.md$/, ".mdx")
607-
);
604+
const mdxName = entry === "README.md" ? "index.mdx" : entry.replace(/\.md$/, ".mdx");
605+
const destFile = path.join(destDir, mdxName);
608606
const converted = convertContent(content, relativePath);
609607

610608
ensureDir(path.dirname(destFile));

0 commit comments

Comments
 (0)