Skip to content

Commit 247b670

Browse files
dawnhoclaude
andcommitted
fix: use original URL paths to preserve all existing links
Output files now match old GitBook URL structure exactly: - guides/ content → root (quickstart, core-concepts/*, etc.) - api-reference/ content → api/ (api/access_codes/create, etc.) - brand-guides/ content → device-and-system-integration-guides/ No redirects needed — all old docs.seam.co/latest/* links work as-is. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34fb0e4 commit 247b670

610 files changed

Lines changed: 621 additions & 631 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: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function parseSummary(summaryPath, spacePrefix) {
391391
pagePath = pagePath.replace(/\.md$/, "");
392392

393393
// Prefix with space name
394-
pagePath = `${spacePrefix}/${pagePath}`;
394+
pagePath = spacePrefix ? `${spacePrefix}/${pagePath}` : pagePath;
395395

396396
if (!currentSection) {
397397
currentSection = { name: "Getting Started", pages: [] };
@@ -430,7 +430,7 @@ function parseSummaryAsGroups(summaryPath, spacePrefix) {
430430
if (pagePath.includes("broken-reference") || pagePath.includes("/broken/")) continue;
431431

432432
pagePath = pagePath.replace(/\.md$/, "");
433-
pagePath = `${spacePrefix}/${pagePath}`;
433+
pagePath = spacePrefix ? `${spacePrefix}/${pagePath}` : pagePath;
434434

435435
items.push({ title, path: pagePath, indent });
436436
}
@@ -618,8 +618,17 @@ function main() {
618618
}
619619
}
620620

621+
// Map GitBook space names to old URL-compatible output paths
622+
const spaceOutputMap = {
623+
"guides": "", // guides go to root
624+
"api-reference": "api",
625+
"brand-guides": "device-and-system-integration-guides",
626+
};
627+
621628
for (const space of spaces) {
622-
processDir(path.join(SRC, space), path.join(DEST, space), space);
629+
const outputPrefix = spaceOutputMap[space] ?? space;
630+
const destDir = outputPrefix ? path.join(DEST, outputPrefix) : DEST;
631+
processDir(path.join(SRC, space), destDir, space);
623632
}
624633
console.log(` ✓ ${fileCount} files converted, ${errorCount} errors`);
625634

@@ -631,14 +640,15 @@ function main() {
631640
const apiSummary = path.join(SRC, "api-reference", "SUMMARY.md");
632641
const brandSummary = path.join(SRC, "brand-guides", "SUMMARY.md");
633642

643+
// Use old URL prefixes for page paths in navigation
634644
const guidesSections = fs.existsSync(guidesSummary)
635-
? parseSummary(guidesSummary, "guides")
645+
? parseSummary(guidesSummary, "")
636646
: [];
637647
const apiGroups = fs.existsSync(apiSummary)
638-
? parseSummaryAsGroups(apiSummary, "api-reference")
648+
? parseSummaryAsGroups(apiSummary, "api")
639649
: [];
640650
const brandGroups = fs.existsSync(brandSummary)
641-
? parseSummaryAsGroups(brandSummary, "brand-guides")
651+
? parseSummaryAsGroups(brandSummary, "device-and-system-integration-guides")
642652
: [];
643653

644654
const docsJson = buildDocsJson(guidesSections, apiGroups, brandGroups);

mintlify-docs/api-reference/access_codes/create_multiple.mdx renamed to mintlify-docs/api/access_codes/create_multiple.mdx

0 commit comments

Comments
 (0)