Initial commit of Astro version
This commit is contained in:
commit
e3d1f6999b
79 changed files with 9880 additions and 0 deletions
27
src/pages/feed.xml.ts
Normal file
27
src/pages/feed.xml.ts
Normal 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(),
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue