feat: rewrite deprecated internal links with .html extension
This commit is contained in:
committed by
Mathias Schopmans
parent
6dbcd45a52
commit
3f79b6264e
@@ -5,4 +5,4 @@ quadrant: languages-and-frameworks
|
||||
tags: [new]
|
||||
---
|
||||
|
||||
This is a new demo entry. Items can [link](/methods-and-patterns/demo-1/) to other items.
|
||||
This is a new demo entry. Items can [link](/methods-and-patterns/demo-1.html) to other items and replaces the old links with a html extension to the new link structure, whereas a new [link](/methods-and-patterns/demo-1/) should be untouched.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aoe_technology_radar",
|
||||
"version": "4.0.0-alpha.9",
|
||||
"version": "4.0.0-alpha.10",
|
||||
"private": true,
|
||||
"bin": {
|
||||
"techradar": "./bin/techradar.js"
|
||||
|
||||
@@ -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}/`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user