chore: myriad fixes + book year pages

This commit is contained in:
Cory Dransfeldt 2024-11-17 11:55:53 -08:00
parent 3ab6f77a69
commit aec8471b06
No known key found for this signature in database
45 changed files with 508 additions and 293 deletions

View file

@ -0,0 +1,23 @@
import { generateRssFeed } from "@utils/generateRssFeed";
import { fetchGlobals } from "@utils/data/globals";
import { fetchBooks } from "@utils/data/books";
import fs from "fs/promises";
import path from "path";
export async function getStaticPaths() {
const globals = await fetchGlobals();
const books = await fetchBooks();
const rss = generateRssFeed({
permalink: "/feeds/books.xml",
title: "Books feed",
globals,
data: books.feed,
});
const filePath = path.resolve("public/feeds/books.xml");
await fs.mkdir(path.dirname(filePath), { recursive: true });
await fs.writeFile(filePath, rss);
return [];
}