rss fixes

This commit is contained in:
2023-07-30 20:43:54 -04:00
parent acceb67d9a
commit ceb456b4fb
10 changed files with 33 additions and 19 deletions
+3 -1
View File
@@ -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,
})),
})
}