update content
This commit is contained in:
parent
836f960a28
commit
d22eb07a55
12 changed files with 217 additions and 1 deletions
41
app/artifacts/essays/feed/route.ts
Normal file
41
app/artifacts/essays/feed/route.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import { Feed } from "feed";
|
||||||
|
import { getArtifacts } from "utils";
|
||||||
|
|
||||||
|
const SITE_URL = "https://chora.io/artifacts/essays";
|
||||||
|
|
||||||
|
function getAllArtifacts() {
|
||||||
|
return [
|
||||||
|
...getArtifacts('essays'),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = false;
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
const feed = new Feed({
|
||||||
|
title: "ryan's artifacts (essays)",
|
||||||
|
description: "ryan's artifacts (essays)",
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
44
app/artifacts/feed/route.ts
Normal file
44
app/artifacts/feed/route.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
import { Feed } from "feed";
|
||||||
|
import { getArtifacts } from "utils";
|
||||||
|
|
||||||
|
const SITE_URL = "https://ryanchristo.com/artifacts";
|
||||||
|
|
||||||
|
function getAllArtifacts() {
|
||||||
|
return [
|
||||||
|
...getArtifacts('essays'),
|
||||||
|
...getArtifacts('film'),
|
||||||
|
...getArtifacts('software'),
|
||||||
|
...getArtifacts('videos'),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = false;
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
const feed = new Feed({
|
||||||
|
title: "ryan's artifacts",
|
||||||
|
description: "ryan's artifacts",
|
||||||
|
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/artifacts/film/feed/route.ts
Normal file
41
app/artifacts/film/feed/route.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import { Feed } from "feed";
|
||||||
|
import { getArtifacts } from "utils";
|
||||||
|
|
||||||
|
const SITE_URL = "https://chora.io/artifacts/film";
|
||||||
|
|
||||||
|
function getAllArtifacts() {
|
||||||
|
return [
|
||||||
|
...getArtifacts('film'),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = false;
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
const feed = new Feed({
|
||||||
|
title: "ryan's artifacts (film)",
|
||||||
|
description: "ryan's artifacts (film)",
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ async function getArtifactsByGroup() {
|
||||||
items: getArtifacts("essays").sort((a, b) => b.order - a.order),
|
items: getArtifacts("essays").sort((a, b) => b.order - a.order),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
group: "film / video",
|
group: "film / videos",
|
||||||
items: [...getArtifacts("film"), ...getArtifacts("videos")].sort(
|
items: [...getArtifacts("film"), ...getArtifacts("videos")].sort(
|
||||||
(a, b) => b.order - a.order,
|
(a, b) => b.order - a.order,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
41
app/artifacts/software/feed/route.ts
Normal file
41
app/artifacts/software/feed/route.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import { Feed } from "feed";
|
||||||
|
import { getArtifacts } from "utils";
|
||||||
|
|
||||||
|
const SITE_URL = "https://chora.io/artifacts/software";
|
||||||
|
|
||||||
|
function getAllArtifacts() {
|
||||||
|
return [
|
||||||
|
...getArtifacts('software'),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = false;
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
const feed = new Feed({
|
||||||
|
title: "ryan's artifacts (software)",
|
||||||
|
description: "ryan's artifacts (software)",
|
||||||
|
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/artifacts/videos/feed/route.ts
Normal file
41
app/artifacts/videos/feed/route.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import { Feed } from "feed";
|
||||||
|
import { getArtifacts } from "utils";
|
||||||
|
|
||||||
|
const SITE_URL = "https://chora.io/artifacts/videos";
|
||||||
|
|
||||||
|
function getAllArtifacts() {
|
||||||
|
return [
|
||||||
|
...getArtifacts('videos'),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = false;
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
const feed = new Feed({
|
||||||
|
title: "ryan's artifacts (videos)",
|
||||||
|
description: "ryan's artifacts (videos)",
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
|
@ -49,6 +49,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu li {
|
.menu li {
|
||||||
|
font-weight: 400;
|
||||||
margin: 0.75em;
|
margin: 0.75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ const Header = () => {
|
||||||
<li>
|
<li>
|
||||||
<Link href="/artifacts">{"artifacts"}</Link>
|
<Link href="/artifacts">{"artifacts"}</Link>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link href="https://git.ryanchristo.com/explore/repos" target="_blank">{"git"}</Link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link href="/artifacts/feed" target="_blank">{"rss"}</Link>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button className={styles.themeButton} onClick={toggleTheme}>
|
<button className={styles.themeButton} onClick={toggleTheme}>
|
||||||
<ThemeIcon darkTheme={darkTheme} />
|
<ThemeIcon darkTheme={darkTheme} />
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"clean": "rm -rf .next dist node_modules"
|
"clean": "rm -rf .next dist node_modules"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"feed": "^6",
|
||||||
"gray-matter": "^4",
|
"gray-matter": "^4",
|
||||||
"next": "^14",
|
"next": "^14",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue