You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
827 B
27 lines
827 B
1 year ago
|
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",
|
||
|
});
|
||
|
}
|