rss fixes
This commit is contained in:
@@ -6,6 +6,7 @@ const parser = new MarkdownIt({ html: true })
|
||||
|
||||
export async function get(context) {
|
||||
const blog = await getCollection('blog')
|
||||
console.log(blog)
|
||||
return rss({
|
||||
title: 'ghall.blog',
|
||||
description:
|
||||
@@ -14,9 +15,10 @@ export async function get(context) {
|
||||
items: blog
|
||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||
.map((post) => ({
|
||||
title: post.data.title,
|
||||
pubDate: post.data.pubDate,
|
||||
link: `/posts/${post.slug}/`,
|
||||
content: sanitizeHtml(parser.render(post.body)),
|
||||
...post.data,
|
||||
})),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user