publish the public CV and fix the availability check to resolve from the project root - Vite rewrites module URLs at build so the relative walk never found public/
build-and-deploy / build (push) Failing after 14m0s

This commit is contained in:
2026-08-18 09:56:59 +10:00
parent b6d3d4487a
commit f6b683713e
2 changed files with 4 additions and 4 deletions
Executable
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -1,9 +1,9 @@
// Build-time checks for optional static assets.
// Astro frontmatter runs at build (SSG), so the filesystem is available here.
// (!) Resolve from the project root, not from import.meta.url - Vite rewrites module URLs
// during the build, so a relative walk up from this file can miss public/ entirely.
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
const publicDir = fileURLToPath(new URL("../../public/", import.meta.url));
import { join } from "node:path";
/** True only when a real CV has been dropped at public/cv.pdf. */
export const cvAvailable = existsSync(publicDir + "cv.pdf");
export const cvAvailable = existsSync(join(process.cwd(), "public", "cv.pdf"));