parent
39f68f0051
commit
9d0a823351
23 changed files with 1158 additions and 31 deletions
|
|
@ -3,6 +3,15 @@ import path from "node:path";
|
|||
|
||||
export const repoRoot = process.cwd();
|
||||
export const websiteRoot = path.join(repoRoot, "website");
|
||||
export const migratedHtmlPages = new Set([
|
||||
"about.html",
|
||||
"contact.html",
|
||||
"events.html",
|
||||
"index.html",
|
||||
"services.html",
|
||||
"the-founders.html",
|
||||
"videos.html",
|
||||
]);
|
||||
|
||||
export function walkHtmlFiles(dir = websiteRoot): string[] {
|
||||
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
||||
|
|
@ -26,6 +35,10 @@ export function routeFromRelativePath(relativePath: string): string {
|
|||
return relativePath;
|
||||
}
|
||||
|
||||
export function isMigratedHtmlPage(relativePath: string): boolean {
|
||||
return migratedHtmlPages.has(relativePath);
|
||||
}
|
||||
|
||||
export function sourcePathFromRoute(route = ""): string {
|
||||
const relativePath = route === "" ? "index.html" : route.endsWith(".html") ? route : `${route}/index.html`;
|
||||
return path.join(websiteRoot, relativePath);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue