[Archived] Archived WIP of vielle.dev
1import rss from "@astrojs/rss";
2import { getCollection } from "astro:content";
3import MarkdownIt from "markdown-it";
4const parser = new MarkdownIt();
5
6export async function GET(context) {
7 const blog = await getCollection("blog");
8 return rss({
9 title: "testing",
10 description: "weeeeeeeeeeeeeeeeeeee",
11 site: context.site,
12 items: blog.map((post) => ({
13 title: post.data.title,
14 pubDate: post.data.date,
15 description: post.data.description,
16 link: `/blog/${post.id}`,
17 content: parser.render(`# ${post.data.title}\n\n${post.body}`),
18 })),
19 customData: `<language>en-GB</language>`,
20 });
21}