diff --git a/app/layout.tsx b/app/layout.tsx index af93498..e35bfbe 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -32,11 +32,17 @@ const Layout = ({ children }: any) => ( title: 'services', target: '', }, - // { - // link: '/validator', - // title: 'validator', - // target: '', - // }, + 'divider', + { + link: 'https://git.chora.studio/explore/repos', + title: 'git', + target: '_blank', + }, + { + link: '/research/feed', + title: 'rss', + target: '_blank', + }, ]} showMenuButton={true} showMobileTitle={true} @@ -63,16 +69,16 @@ const Layout = ({ children }: any) => ( target: '', title: 'services', }, - // { - // link: 'validator', - // target: '', - // title: 'validator', - // }, - // { - // link: 'https://www.mintscan.io/regen/validators/regenvaloper1t8p3zdu3h8qzggfmvvvmtdnaj4trcsfh79xp4e', - // target: '_blank', - // title: 'chora validator', - // }, + { + link: 'https://git.chora.studio/explore/repos', + title: 'git', + target: '_blank', + }, + { + link: '/research/feed', + title: 'rss', + target: '_blank', + }, ]} mobileOnly={true} /> @@ -107,33 +113,22 @@ const Layout = ({ children }: any) => ( target: '', title: 'services', }, - // { - // link: '/validator', - // target: '', - // title: 'validator', - // }, ], }, - // { - // title: 'chora validator', - // items: [ - // { - // link: 'https://www.mintscan.io/regen/validators/regenvaloper1t8p3zdu3h8qzggfmvvvmtdnaj4trcsfh79xp4e', - // target: '_blank', - // title: 'regen', - // }, - // { - // link: 'https://ledger.chora.io/regen-redwood-1/validators/regenvaloper1399y9huuus9phlv2d5fjnznem65nlmsn0qgfrd', - // target: '_blank', - // title: 'regen-redwood', - // }, - // { - // link: 'https://ledger.chora.io/chora-testnet-1/validators/choravaloper1394r2mejx4vaqrqkqm63k8m3qdsx6xzjquwy7u', - // target: '_blank', - // title: 'chora-testnet', - // }, - // ], - // }, + { + title: 'more links', + items: [ + { + link: 'https://git.chora.studio/explore/repos', + title: 'git', + target: '_blank', + }, + { + link: '/research/feed', + title: 'rss', + target: '_blank', + },], + }, ]} /> diff --git a/app/research/about/feed/route.ts b/app/research/about/feed/route.ts new file mode 100644 index 0000000..0cdb5d5 --- /dev/null +++ b/app/research/about/feed/route.ts @@ -0,0 +1,41 @@ +import { Feed } from "feed"; +import { getArtifacts } from "utils"; + +const SITE_URL = "https://chora.studio/research/about"; + +function getAllArtifacts() { + return [ + ...getArtifacts('about'), + ] +} + +export const revalidate = false; + +export async function GET() { + const feed = new Feed({ + title: "chora research (about)", + description: "chora research (about)", + 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", + }, + }); +} diff --git a/app/research/concepts/feed/route.ts b/app/research/concepts/feed/route.ts new file mode 100644 index 0000000..1931559 --- /dev/null +++ b/app/research/concepts/feed/route.ts @@ -0,0 +1,41 @@ +import { Feed } from "feed"; +import { getArtifacts } from "utils"; + +const SITE_URL = "https://chora.studio/research/concepts"; + +function getAllArtifacts() { + return [ + ...getArtifacts('concepts'), + ] +} + +export const revalidate = false; + +export async function GET() { + const feed = new Feed({ + title: "chora research (concepts)", + description: "chora research (concepts)", + 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", + }, + }); +} diff --git a/app/research/feed/route.ts b/app/research/feed/route.ts new file mode 100644 index 0000000..e16d2a3 --- /dev/null +++ b/app/research/feed/route.ts @@ -0,0 +1,43 @@ +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", + }, + }); +} diff --git a/app/research/tutorials/feed/route.ts b/app/research/tutorials/feed/route.ts new file mode 100644 index 0000000..390ce31 --- /dev/null +++ b/app/research/tutorials/feed/route.ts @@ -0,0 +1,41 @@ +import { Feed } from "feed"; +import { getArtifacts } from "utils"; + +const SITE_URL = "https://chora.studio/research/tutorials"; + +function getAllArtifacts() { + return [ + ...getArtifacts('tutorials'), + ] +} + +export const revalidate = false; + +export async function GET() { + const feed = new Feed({ + title: "chora research (tutorials)", + description: "chora research (tutorials)", + 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", + }, + }); +} diff --git a/bun.lockb b/bun.lockb index 8013ac2..dec4189 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 194f31a..7fc44ed 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "clean": "rm -rf .next dist node_modules" }, "dependencies": { + "feed": "^6.0.0", "gray-matter": "^4", "next": "^14", "react": "^18",