Improve feeds according to W3C
This commit is contained in:
parent
d56a8cc95d
commit
c1a59ed51a
9 changed files with 137 additions and 53 deletions
|
|
@ -6,6 +6,9 @@ import { blogFeedItem, gameFeedItem, storyFeedItem, type EntryWithPubDate } from
|
|||
const MAX_ITEMS = 8;
|
||||
|
||||
export const GET: APIRoute = async ({ site }) => {
|
||||
if (!site) {
|
||||
throw new Error("site is required.");
|
||||
}
|
||||
const stories = (
|
||||
(await getCollection(
|
||||
"stories",
|
||||
|
|
@ -28,7 +31,9 @@ export const GET: APIRoute = async ({ site }) => {
|
|||
return rss({
|
||||
title: "Gallery | Bad Manners",
|
||||
description: "Stories, games, and more by Bad Manners.",
|
||||
site: site!,
|
||||
site: site,
|
||||
xmlns: { atom: "http://www.w3.org/2005/Atom" },
|
||||
customData: `<link href="${site}" rel="alternate" type="text/html" /><atom:link href="${new URL("feed.xml", site)}" rel="self" type="application/rss+xml" />`,
|
||||
items: await Promise.all(
|
||||
[
|
||||
stories.map(({ data, slug, render }) => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue