Skip to content

Commit 93787d9

Browse files
committed
One off transform to fix link transformation
Signed-off-by: Pete Cheslock <[email protected]>
1 parent 7bf1549 commit 93787d9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

remote-content/remote-sources/repo-transforms.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,19 @@ export function transformRepo(content, { repoUrl, branch, sourcePath = '' }) {
168168
// Get the directory of the source file to resolve relative paths correctly
169169
const sourceDir = sourcePath ? sourcePath.split('/').slice(0, -1).join('/') : '';
170170

171-
return fixImages(applyBasicMdxFixes(content), repoUrl, branch, sourceDir)
171+
// Fix known broken upstream links before other transformations
172+
// These specific URLs point to a non-existent 'dev' branch, redirect to 'main'
173+
let fixedContent = content
174+
.replace(
175+
/https:\/\/github\.com\/llm-d\/llm-d\/tree\/dev\//g,
176+
'https://github.com/llm-d/llm-d/tree/main/'
177+
)
178+
.replace(
179+
/https:\/\/github\.com\/llm-d\/llm-d\/blob\/dev\//g,
180+
'https://github.com/llm-d/llm-d/blob/main/'
181+
);
182+
183+
return fixImages(applyBasicMdxFixes(fixedContent), repoUrl, branch, sourceDir)
172184
// All relative links go to source repository (inline format)
173185
.replace(/\]\((?!http|https|#|mailto:)([^)]+)\)/g, (match, path) => {
174186
const cleanPath = path.replace(/^\]\(/, '');

0 commit comments

Comments
 (0)