www: port fresh.deno.dev to vite (#3227)

This PR ports fresh.deno.dev to use our vite plugin.
This commit is contained in:
Marvin Hagemeister
2025-08-29 16:41:16 +02:00
committed by GitHub
parent 8f8a6174ec
commit 4fe0199c9f
10 changed files with 207 additions and 352 deletions
+4 -1
View File
@@ -120,7 +120,10 @@ export const handler = define.handlers<Data>({
}
// Parse markdown front matter
const url = new URL(`../../../${entry.file}`, import.meta.url);
// deno-lint-ignore no-explicit-any
const url = (import.meta as any).env.PROD
? new URL(`../${entry.file}`, import.meta.url)
: new URL(`../../../${entry.file}`, import.meta.url);
const fileContent = await Deno.readTextFile(url);
const { body, attrs } = frontMatter<Record<string, unknown>>(fileContent);