Skip to content

Commit 31992bb

Browse files
committed
fix(rss): add timestamp to guid
1 parent 52f32bb commit 31992bb

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

apps/site/next-data/generators/websiteFeeds.mjs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ const generateWebsiteFeeds = ({ posts }) => {
3333

3434
const blogFeedEntries = posts
3535
.filter(post => post.categories.includes(category))
36-
.map(post => ({
37-
id: post.slug,
38-
title: post.title,
39-
author: post.author,
40-
date: new Date(post.date),
41-
link: `${canonicalUrl}${post.slug}`,
42-
}));
36+
.map(post => {
37+
const date = new Date(post.date);
38+
return {
39+
id: post.slug,
40+
title: post.title,
41+
author: post.author,
42+
date,
43+
link: `${canonicalUrl}${post.slug}`,
44+
guid: `${post.slug}?${date.getTime()}`,
45+
};
46+
});
4347

4448
blogFeedEntries.forEach(entry => feed.addItem(entry));
4549

0 commit comments

Comments
 (0)