import rss from "@astrojs/rss"; import { getCollection } from "astro:content"; export async function get(context) { const fics = (await getCollection("fanfic")) .filter( (entry) => (!entry.data.wip || process.env.NODE_ENV === "development") && !entry.data.parent ) .map((fic) => ({ title: fic.data.title, // fics dont have a published date and it's required for some reason, literally 1984 pubDate: new Date(441763200000), description: fic.data.description ?? "", link: `/fanfic/${fic.slug}/`, })); return rss({ title: "Ruthenic's fanfics", description: "My fanfics.", site: context.site, items: fics, stylesheet: "/rssStyle.xsl", }); }