Skip to content

Commit

Permalink
fix: fix broken post links and hide draft posts in rss feed
Browse files Browse the repository at this point in the history
  • Loading branch information
satnaing committed Nov 11, 2022
1 parent cce7edd commit b83c906
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ export const get = () =>
title: SITE.title,
description: SITE.desc,
site: SITE.website,
items: posts.map(({ frontmatter }) => ({
link: slugify(frontmatter),
title: frontmatter.title,
description: frontmatter.description,
pubDate: new Date(frontmatter.datetime),
})),
items: posts
.filter(({ frontmatter }) => !frontmatter.draft)
.map(({ frontmatter }) => ({
link: `posts/${slugify(frontmatter)}`,
title: frontmatter.title,
description: frontmatter.description,
pubDate: new Date(frontmatter.datetime),
})),
});

0 comments on commit b83c906

Please sign in to comment.