Improve age-restricted hyperlinks and clean up markup
This commit is contained in:
parent
67e17ae27f
commit
4f6b320d31
13 changed files with 117 additions and 63 deletions
|
|
@ -1,27 +1,22 @@
|
|||
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";
|
||||
import { TOS_FEED } from "../data/tos";
|
||||
|
||||
export const GET: APIRoute = async ({ site }) => {
|
||||
export const GET: APIRoute = ({ 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(),
|
||||
),
|
||||
},
|
||||
],
|
||||
items: TOS_FEED.map(({ status, updatedAt }) => ({
|
||||
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.",
|
||||
}[status],
|
||||
link: "https://badmanners.xyz/terms_of_service",
|
||||
pubDate: subMinutes(dateSet(updatedAt, { hours: 12, minutes: 0, seconds: 0 }), updatedAt.getTimezoneOffset()),
|
||||
})),
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue