[Misc/Docs] Fix Typedoc workflow to not break the "go to main" link

This commit is contained in:
Bertie690 2025-09-06 13:06:35 -04:00
parent 550f3b896e
commit 96dd9d185a

View File

@ -19,15 +19,10 @@ export function load(app) {
app.renderer.on(Renderer.EVENT_END_PAGE, page => {
if (page.pageKind === PageKind.Index && page.contents) {
page.contents = page.contents
// Replace links to the beta documentation site with the current ref name
// Replace the SVG to the beta documentation site with the current ref name
.replace(
/href="(.*pagefaultgames.github.io\/pokerogue\/).*?"/, // formatting
`href="$1/${process.env.REF_NAME}"`,
)
// Replace the link to Beta's coverage SVG with the SVG file for the branch in question.
.replace(
/img src=".*?coverage.svg/, // formatting
`img src="coverage.svg"`,
/^<a href="(.*?)\/beta(.*?)"><img src=".*coverage.svg"/m, // formatting
`<a href="$1/${process.env.REF_NAME}$2"><"coverage.svg"`,
);
}
});