Skip to content

Commit 2b9011e

Browse files
authored
Fix urls to product updates in Latest Changes component (#6528)
1 parent 9286792 commit 2b9011e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/generate-changelog.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ for (const file of files) {
2424
const { data } = matter(content);
2525

2626
if (data.title && data.date) {
27+
const pathname = file
28+
.replace('.mdx', '')
29+
.replace('(posts)/', '')
30+
.replace(/\/page$/, '');
31+
2732
changelogRecords.push({
2833
date: new Date(data.date).toLocaleDateString(undefined, {
2934
day: 'numeric',
3035
month: 'long',
3136
year: 'numeric',
3237
}),
33-
href: `https://the-guild.dev/graphql/hive/product-updates/${file.replace('.mdx', '')}`,
38+
href: `https://the-guild.dev/graphql/hive/product-updates/${pathname}`,
3439
title: data.title,
3540
description: data.description || '',
3641
});

0 commit comments

Comments
 (0)