mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: fix broken post links and hide draft posts in rss feed
This commit is contained in:
@@ -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),
|
||||
})),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user