feat: rewrite deprecated internal links with .html extension

This commit is contained in:
Mathias Schopmans
2024-03-11 10:16:13 +01:00
committed by Mathias Schopmans
parent 6dbcd45a52
commit 3f79b6264e
3 changed files with 5 additions and 2 deletions

View File

@@ -37,6 +37,9 @@ function dataPath(...paths: string[]): string {
}
function convertToHtml(markdown: string): string {
// replace deprecated internal links with .html extension
markdown = markdown.replace(/(]\(\/[^)]+)\.html/g, "$1/");
if (nextConfig.basePath) {
markdown = markdown.replace(/]\(\//g, `](${nextConfig.basePath}/`);
}