feat: update content
This commit is contained in:
parent
eaf8ed7d5d
commit
ad1e22c631
7 changed files with 122 additions and 54 deletions
|
|
@ -1,43 +0,0 @@
|
|||
import { Feed } from "feed";
|
||||
import { getArtifacts } from "utils";
|
||||
|
||||
const SITE_URL = "https://chora.studio/research";
|
||||
|
||||
function getAllArtifacts() {
|
||||
return [
|
||||
...getArtifacts('about'),
|
||||
...getArtifacts('concepts'),
|
||||
...getArtifacts('tutorials'),
|
||||
]
|
||||
}
|
||||
|
||||
export const revalidate = false;
|
||||
|
||||
export async function GET() {
|
||||
const feed = new Feed({
|
||||
title: "chora research",
|
||||
description: "chora research",
|
||||
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.category}/${a.id}`,
|
||||
link: `${SITE_URL}/${a.category}/${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