I'm trying to make an RSS feed for my site, loosly following the Add an RSS Feed guide. It says that include the post content, you need a third-party Markdown parser like Markdown-IT, but earlier today I used post.render() in content collections, which seemed to return plain HTML, so I tried to use that instead. Here is the file:
// rss.xml.js
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
renderedPost = await post.render()
export async function get() {
const posts = await getCollection('blog');
return rss({
title: 'Southpaw1496',
description: 'My Blog',
site: 'https://southpaw1496.me/',
items: posts.map((post) => ({
title: post.data.title,
pubDate: post.data.pubDate,
description: post.data.description,
link: `/blog/${post.slug}/`,
content: renderedPost,
})),
customData: `<language>en-gb</language>`,
});
};
When I try to use this file, running curl localhost:4321/rss.xml, it returns
<title>ReferenceError</title><script type="module" src="/@vite/client"></script>%
Why might this be happening?