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

@@ -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.

View File

@@ -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"

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}/`);
}