update content

This commit is contained in:
ryanchristo 2026-11-20 08:33:43 -08:00
parent d22eb07a55
commit 339a4cb482
No known key found for this signature in database
16 changed files with 166 additions and 264 deletions

51
utils/buildFeed.ts Normal file
View file

@ -0,0 +1,51 @@
import { Feed } from "feed";
import { getArtifacts } from "utils";
const SITE_URL = "https://ryanchristo.com";
function getAllArtifacts() {
return [
...getArtifacts('essays'),
// ...getArtifacts('film'),
// ...getArtifacts('software'),
// ...getArtifacts('videos'),
]
}
export function buildFeed() {
const feed = new Feed({
title: "Ryan Christoffersen",
description: "Ryan Christoffersen's Feed",
id: SITE_URL,
link: SITE_URL,
language: "en",
favicon: `${SITE_URL}/favicon.ico`,
feedLinks: {
rss2: `${SITE_URL}/feed`,
atom: `${SITE_URL}/feed/atom`,
json: `${SITE_URL}/feed/json`,
},
author: { name: "Ryan Christoffersen" },
copyright: "All rights reserved",
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.updated,
published: a.created,
author: [{ name: a.author }],
category: [{ name: a.category }],
content: a.content,
audio: a.audio,
video: a.video,
copyright: "All rights reserved",
});
}
return feed;
}

View file

@ -6,7 +6,8 @@ import html from "remark-html";
const root = path.join(process.cwd(), "artifacts");
export async function getArtifact(dir: string, id: string) {
export const getArtifact = async (dir: string, id: string) => {
// set file path
const fullPath = path.join(root, dir, `${id}.md`);
// read file contents