Skip to content

Commit bfb21c4

Browse files
committed
🐛 fix broken links
1 parent 267629c commit bfb21c4

File tree

2 files changed

+78
-1669
lines changed

2 files changed

+78
-1669
lines changed

packages/plugin-changelog/src/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ function getPaginator(chunks: Section[][], prevIdx: number, nextIdx: number) {
1414
if (prevIdx >= 0 && prevIdx < chunks.length) {
1515
const chunk = chunks?.[prevIdx]?.[0];
1616
if (chunk) {
17-
content += ` previous={{ title: "${chunk.title}", permalink: "/changelog/${encodeURIComponent(chunk.title)}" }}`;
17+
const title = prevIdx === 0 ? "" : encodeURIComponent(chunk.title);
18+
content += ` previous={{ title: "${chunk.title}", permalink: "/changelog/${title}" }}`;
1819
}
1920
}
2021

2122
if (nextIdx >= 0 && nextIdx < chunks.length) {
2223
const chunk = chunks?.[nextIdx]?.[0];
2324
if (chunk) {
24-
content += ` next={{ title: "${chunk.title}", permalink: "/changelog/${encodeURIComponent(chunk.title)}" }}`;
25+
content += ` next={{ title: "${
26+
chunk.title
27+
}", permalink: "/changelog/${encodeURIComponent(chunk.title)}" }}`;
2528
}
2629
}
2730

0 commit comments

Comments
 (0)