Skip to content

Commit fcd17c1

Browse files
committed
doc/starlight/changelog: swap IDs with Github links
1 parent dacb3aa commit fcd17c1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/starlight/src/content.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ export function changelogLoader(): Loader {
9797
.slice(currentReleaseHeadingIndex + 1, index)
9898
.join("\n");
9999

100+
// Replace #ID entries with links to GitHub issues
101+
// Github treats both PRs and Issues the same way regarding links
102+
const contentWithGithubLinks = currentReleaseContent.replace(
103+
/#(\d+)/g,
104+
"[#$1](https://github.com/RIOT-OS/RIOT/issues/$1)",
105+
);
106+
100107
// Add entry to content collection
101108
context.store.set({
102109
id: slug,
@@ -108,9 +115,9 @@ export function changelogLoader(): Loader {
108115
codeName: codeName,
109116
slug: slug,
110117
date: date,
111-
markdown: currentReleaseContent,
118+
markdown: contentWithGithubLinks,
112119
},
113-
rendered: await context.renderMarkdown(currentReleaseContent),
120+
rendered: await context.renderMarkdown(contentWithGithubLinks),
114121
});
115122
}
116123

0 commit comments

Comments
 (0)