feat: add git and rss
This commit is contained in:
parent
f9beb971e7
commit
eaf8ed7d5d
7 changed files with 202 additions and 40 deletions
|
|
@ -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',
|
||||
},],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</MenuContextProvider>
|
||||
|
|
|
|||
41
app/research/about/feed/route.ts
Normal file
41
app/research/about/feed/route.ts
Normal file
|
|
@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
41
app/research/concepts/feed/route.ts
Normal file
41
app/research/concepts/feed/route.ts
Normal file
|
|
@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
43
app/research/feed/route.ts
Normal file
43
app/research/feed/route.ts
Normal file
|
|
@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
41
app/research/tutorials/feed/route.ts
Normal file
41
app/research/tutorials/feed/route.ts
Normal file
|
|
@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue