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
+1 -1
View File
@@ -5,7 +5,7 @@ title: Page Not Found
My name is **Graham**, a web developer from Rhode Island.
When I'm not writing code, I'm usually enjoying one of my other hobbies; video games, music, hiking, photography, art, the list goes on...
When I'm not writing code, I'm usually enjoying one of my other hobbies; video games, board games, music, hiking, photography, art, the list goes on...
I also like writing about stuff, so I put together this site to share whatever's on my mind about the world of tech, gaming, life, web development, and whatever else strikes my fancy.
+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,
})),
})
}