aria.coffee/src/pages/rss.xml.js

18 lines
492 B
JavaScript

import { getCollection } from "astro:content";
import rss from "@astrojs/rss";
export async function GET(context) {
const posts = await getCollection("blog");
return rss({
title: "Aria | Blog",
description: "Just me being a silly little thing",
site: context.site,
items: posts.map((post) => ({
title: post.data.title,
pubDate: post.data.pubDate,
description: post.data.description,
link: `/posts/${post.id}/`,
})),
customData: `<language>en-us</language>`,
});
}