Skip to content

Commit 7c27a16

Browse files
committed
fix(fetch): rewrite internal markdown links to folder-style URLs during Governance fetch
1 parent 4dc4be6 commit 7c27a16

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/utilities/fetch-governance.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ function generateTitle(filename) {
3535
.replace(/\b\w/g, (c) => c.toUpperCase());
3636
}
3737

38+
// Fix internal markdown links (.md → /) for static site compatibility
39+
function fixMarkdownLinks(content) {
40+
return content.replace(/(\]\([A-Z0-9_-]+)\.md(\))/gi, '$1/$2');
41+
}
42+
3843
// Helper to get slug from filename
3944
function destSlugFromFilename(destFile) {
4045
const name = path.basename(destFile, path.extname(destFile));
@@ -71,7 +76,8 @@ async function fetchGovernanceDocs() {
7176
if (!destFile) continue;
7277

7378
const response = await fetch(file.download_url);
74-
const content = await response.text();
79+
let content = await response.text();
80+
content = fixMarkdownLinks(content);
7581
const title = generateTitle(filename);
7682

7783
const sortOrder =

0 commit comments

Comments
 (0)