Initial commit of Astro version

This commit is contained in:
Bad Manners 2024-08-15 21:27:00 -03:00
commit e3d1f6999b
79 changed files with 9880 additions and 0 deletions

27
src/pages/feed.xml.ts Normal file
View file

@ -0,0 +1,27 @@
import rss from "@astrojs/rss";
import type { APIRoute } from "astro";
import { set as dateSet, subMinutes } from "date-fns";
import { TOS_COMMISSION_STATUS, TOS_UPDATED_AT } from "../data/tos";
export const GET: APIRoute = async ({ site }) => {
return rss({
title: "Bad Manners",
description: "Bad Manners status updates",
site: site!,
items: [
{
title: {
CLOSED: "Story commissions are closed.",
OPEN: "Story commissions are open!",
SEMI_OPEN: "Story commissions are semi-open, and I may accept them less frequently.",
PRIVATE: "Story commissions are private; they are only open to select commissioners.",
}[TOS_COMMISSION_STATUS],
link: "https://badmanners.xyz/terms_of_service",
pubDate: subMinutes(
dateSet(TOS_UPDATED_AT, { hours: 12, minutes: 0, seconds: 0 }),
TOS_UPDATED_AT.getTimezoneOffset(),
),
},
],
});
};