This commit is contained in:
ryanchristo 2026-11-19 13:47:56 -08:00
parent 71590024e7
commit c135cb24f1
No known key found for this signature in database
7 changed files with 97 additions and 3 deletions

View file

@ -0,0 +1,41 @@
import { Feed } from "feed";
import { getArtifacts } from "utils";
const SITE_URL = "https://chora.io/artifacts/choreography";
function getAllArtifacts() {
return [
...getArtifacts('choreography'),
]
}
export const revalidate = false;
export async function GET() {
const feed = new Feed({
title: "chora artifacts (choreography)",
description: "chora artifacts (choreography)",
id: SITE_URL,
link: SITE_URL,
language: "en",
feedLinks: { rss2: `${SITE_URL}/feed.xml` },
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",
},
});
}

View file

@ -0,0 +1,41 @@
import { Feed } from "feed";
import { getArtifacts } from "utils";
const SITE_URL = "https://chora.io/artifacts";
function getAllArtifacts() {
return [
...getArtifacts('choreography'),
]
}
export const revalidate = false;
export async function GET() {
const feed = new Feed({
title: "chora artifacts",
description: "chora artifacts",
id: SITE_URL,
link: SITE_URL,
language: "en",
feedLinks: { rss2: `${SITE_URL}/feed.xml` },
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",
},
});
}

View file

@ -9,14 +9,14 @@ export const metadata: Metadata = {
title: 'chora | artifacts',
}
async function getResearchArtifacts() {
async function getAllArtifacts() {
return [
{ group: 'choreography', items: getArtifacts('choreography') },
]
}
const ResearchPage = async () => {
const artifacts = await getResearchArtifacts()
const artifacts = await getAllArtifacts()
return (
<div className={styles.page}>
<div className={styles.banner}>

View file

@ -21,6 +21,17 @@ const Layout = ({ children }: any) => (
title: 'artifacts',
target: '',
},
'divider',
{
link: 'https://git.chora.io',
title: 'git',
target: '_blank',
},
{
link: '/artifacts/feed',
title: 'rss',
target: '_blank',
}
]}
showMenuButton={true}
showMobileTitle={true}

View file

@ -15,7 +15,7 @@ const HomePage = () => {
{'chora'}
</h1>
<p>
<i>{'a third thing or perhaps no thing'}</i>
<i>{'a third thing... or perhaps nothing'}</i>
</p>
<p>{'open protocol'}</p>
</div>

BIN
bun.lockb

Binary file not shown.

View file

@ -20,6 +20,7 @@
"clean": "rm -rf .next dist node_modules"
},
"dependencies": {
"feed": "^6",
"gray-matter": "^4",
"next": "^14",
"react": "^18",