Drive archive posts from content

This commit is contained in:
Loyyd 2026-06-11 14:19:57 +02:00
parent d74495ddef
commit b4025aecaf
4 changed files with 276 additions and 2 deletions

View file

@ -1,10 +1,13 @@
import fs from "node:fs/promises";
import { contentSourceRoutes } from "../lib/content-routes";
import { isMigratedHtmlPage, relativeWebsitePath, routeFromRelativePath, sourcePathFromRoute, walkHtmlFiles } from "../lib/static-pages";
export function getStaticPaths() {
export async function getStaticPaths() {
const markdownRoutes = await contentSourceRoutes();
return walkHtmlFiles()
.map(relativeWebsitePath)
.filter((relativePath) => !isMigratedHtmlPage(relativePath))
.filter((relativePath) => !isMigratedHtmlPage(relativePath) && !markdownRoutes.has(relativePath))
.map((relativePath) => ({
params: {
route: routeFromRelativePath(relativePath),