Fix urls to product updates in Latest Changes component (#6528)

This commit is contained in:
Kamil Kisiela 2025-02-17 11:42:01 +01:00 committed by GitHub
parent 92867925f1
commit 2b9011ea71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,13 +24,18 @@ for (const file of files) {
const { data } = matter(content);
if (data.title && data.date) {
const pathname = file
.replace('.mdx', '')
.replace('(posts)/', '')
.replace(/\/page$/, '');
changelogRecords.push({
date: new Date(data.date).toLocaleDateString(undefined, {
day: 'numeric',
month: 'long',
year: 'numeric',
}),
href: `https://the-guild.dev/graphql/hive/product-updates/${file.replace('.mdx', '')}`,
href: `https://the-guild.dev/graphql/hive/product-updates/${pathname}`,
title: data.title,
description: data.description || '',
});