mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
fix: troubleshooting sync (#33908)
Relative links don't make sense in GitHub discussions so they need to be converted to absolute links for syncing.
This commit is contained in:
1 parent
07b23991c3
commit
e97ca89ab1
1 file changed
+15
@@ -158,7 +158,12 @@ export async function getAllTroubleshootingEntriesInternal() {
|
||||
].includes(child.type)
|
||||
)
|
||||
}
|
||||
|
||||
if (node.type === 'link' || node.type === 'image') {
|
||||
canonicalizeUrl(node)
|
||||
}
|
||||
})
|
||||
|
||||
const contentWithoutJsx = toMarkdown(mdxTree, {
|
||||
extensions: [gfmToMarkdown()],
|
||||
})
|
||||
@@ -174,6 +179,16 @@ export async function getAllTroubleshootingEntriesInternal() {
|
||||
return (await Promise.all(troubleshootingFiles)).filter((x) => x != null)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import('mdast').Image | import('mdast').Link} node
|
||||
*/
|
||||
function canonicalizeUrl(node) {
|
||||
if (node.url.startsWith('/')) {
|
||||
node.url === 'https://supabase.com' + node.url
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {TroubleshootingEntry} entry
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user