diff --git a/app/artifacts/essays/feed/route.ts b/app/artifacts/essays/feed/route.ts new file mode 100644 index 0000000..5663b7d --- /dev/null +++ b/app/artifacts/essays/feed/route.ts @@ -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", + }, + }); +} diff --git a/app/artifacts/feed/route.ts b/app/artifacts/feed/route.ts new file mode 100644 index 0000000..b236463 --- /dev/null +++ b/app/artifacts/feed/route.ts @@ -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", + }, + }); +} diff --git a/app/artifacts/film/feed/route.ts b/app/artifacts/film/feed/route.ts new file mode 100644 index 0000000..221855a --- /dev/null +++ b/app/artifacts/film/feed/route.ts @@ -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", + }, + }); +} diff --git a/app/artifacts/page.tsx b/app/artifacts/page.tsx index c047bf9..ec4302b 100644 --- a/app/artifacts/page.tsx +++ b/app/artifacts/page.tsx @@ -16,7 +16,7 @@ async function getArtifactsByGroup() { items: getArtifacts("essays").sort((a, b) => b.order - a.order), }, { - group: "film / video", + group: "film / videos", items: [...getArtifacts("film"), ...getArtifacts("videos")].sort( (a, b) => b.order - a.order, ), diff --git a/app/artifacts/software/feed/route.ts b/app/artifacts/software/feed/route.ts new file mode 100644 index 0000000..2b5083e --- /dev/null +++ b/app/artifacts/software/feed/route.ts @@ -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", + }, + }); +} diff --git a/app/artifacts/video/[id]/page.module.css b/app/artifacts/videos/[id]/page.module.css similarity index 100% rename from app/artifacts/video/[id]/page.module.css rename to app/artifacts/videos/[id]/page.module.css diff --git a/app/artifacts/video/[id]/page.tsx b/app/artifacts/videos/[id]/page.tsx similarity index 100% rename from app/artifacts/video/[id]/page.tsx rename to app/artifacts/videos/[id]/page.tsx diff --git a/app/artifacts/videos/feed/route.ts b/app/artifacts/videos/feed/route.ts new file mode 100644 index 0000000..65b1dc6 --- /dev/null +++ b/app/artifacts/videos/feed/route.ts @@ -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", + }, + }); +} diff --git a/bun.lockb b/bun.lockb index ee23e92..49a0933 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/Header.module.css b/components/Header.module.css index 2284562..da1be8a 100644 --- a/components/Header.module.css +++ b/components/Header.module.css @@ -49,6 +49,7 @@ } .menu li { + font-weight: 400; margin: 0.75em; } diff --git a/components/Header.tsx b/components/Header.tsx index b398254..73f1bd0 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -34,6 +34,12 @@ const Header = () => {
  • {"artifacts"}
  • +
  • + {"git"} +
  • +
  • + {"rss"} +