Skip to content

Commit

Permalink
feat: rewrite deprecated internal links with .html extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasschopmans committed Mar 11, 2024
1 parent 6dbcd45 commit 3f79b62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/radar/2024-03-01/demo-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 3 additions & 0 deletions scripts/buildData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`);
}
Expand Down

0 comments on commit 3f79b62

Please sign in to comment.