update content
This commit is contained in:
parent
836f960a28
commit
d22eb07a55
12 changed files with 217 additions and 1 deletions
41
app/artifacts/software/feed/route.ts
Normal file
41
app/artifacts/software/feed/route.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { Feed } from "feed";
|
||||
import { getArtifacts } from "utils";
|
||||
|
||||
const SITE_URL = "https://chora.io/artifacts/software";
|
||||
|
||||
function getAllArtifacts() {
|
||||
return [
|
||||
...getArtifacts('software'),
|
||||
]
|
||||
}
|
||||
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET() {
|
||||
const feed = new Feed({
|
||||
title: "ryan's artifacts (software)",
|
||||
description: "ryan's artifacts (software)",
|
||||
id: SITE_URL,
|
||||
link: SITE_URL,
|
||||
language: "en",
|
||||
feedLinks: { rss2: `${SITE_URL}/feed` },
|
||||
ttl: 60,
|
||||
});
|
||||
|
||||
for (const a of getAllArtifacts()) {
|
||||
feed.addItem({
|
||||
title: a.title,
|
||||
id: `${SITE_URL}/${a.id}`,
|
||||
link: `${SITE_URL}/${a.id}`,
|
||||
description: a.description,
|
||||
date: a.created,
|
||||
});
|
||||
}
|
||||
|
||||
return new Response(feed.rss2(), {
|
||||
headers: {
|
||||
"Content-Type": "application/rss+xml; charset=utf-8",
|
||||
"Cache-Control": "public, max-age=3600",
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue