feat: update content

This commit is contained in:
ryanchristo 2026-11-20 09:24:21 -08:00
parent eaf8ed7d5d
commit ad1e22c631
No known key found for this signature in database
7 changed files with 122 additions and 54 deletions

12
app/feed/atom/route.ts Normal file
View file

@ -0,0 +1,12 @@
import { buildFeed } from "utils/buildFeed";
export const revalidate = false;
export async function GET() {
return new Response(buildFeed().atom1(), {
headers: {
"Content-Type": "application/atom+xml; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}

12
app/feed/json/route.ts Normal file
View file

@ -0,0 +1,12 @@
import { buildFeed } from "utils/buildFeed";
export const revalidate = false;
export async function GET() {
return new Response(buildFeed().json1(), {
headers: {
"Content-Type": "application/feed+json; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}

12
app/feed/rss/route.ts Normal file
View file

@ -0,0 +1,12 @@
import { buildFeed } from "utils/buildFeed";
export const revalidate = false;
export async function GET() {
return new Response(buildFeed().rss2(), {
headers: {
"Content-Type": "application/rss+xml; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}

View file

@ -7,6 +7,11 @@ import './globals.css'
const Layout = ({ children }: any) => (
<html lang="en">
<head>
<link rel="alternate" type="application/rss+xml" title="rss" href="/feed/rss" />
<link rel="alternate" type="application/atom+xml" title="atom" href="/feed/atom" />
<link rel="alternate" type="application/feed+json" title="json" href="/feed/json" />
</head>
<body>
<ThemeContextProvider>
<MenuContextProvider>
@ -34,12 +39,7 @@ const Layout = ({ children }: any) => (
},
'divider',
{
link: 'https://git.chora.studio/explore/repos',
title: 'git',
target: '_blank',
},
{
link: '/research/feed',
link: '/feed/rss',
title: 'rss',
target: '_blank',
},
@ -69,14 +69,19 @@ const Layout = ({ children }: any) => (
target: '',
title: 'services',
},
{
link: '/feed/rss',
title: 'rss',
target: '_blank',
},
{
link: 'https://git.chora.studio/explore/repos',
title: 'git',
target: '_blank',
},
{
link: '/research/feed',
title: 'rss',
link: '/key.asc',
title: 'pgp',
target: '_blank',
},
]}
@ -118,16 +123,22 @@ const Layout = ({ children }: any) => (
{
title: 'more links',
items: [
{
link: '/feed/rss',
title: 'rss',
target: '_blank',
},
{
link: 'https://git.chora.studio/explore/repos',
title: 'git',
target: '_blank',
},
{
link: '/research/feed',
title: 'rss',
link: '/key.asc',
title: 'pgp',
target: '_blank',
},],
},
],
},
]}
/>

View file

@ -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",
},
});
}