rework/lightweight #12

Merged
GauthierWebDev merged 106 commits from rework/lightweight into main 2025-04-21 16:27:38 +00:00
2 changed files with 13 additions and 1 deletions
Showing only changes of commit d49476236e - Show all commits

11
app/buildPublicUrl.ts Normal file
View File

@ -0,0 +1,11 @@
import { config } from "@/config";
export function buildPublicUrl(resource: string) {
const { BASE_URL } = config;
if (BASE_URL) {
return new URL(resource, BASE_URL).toString();
}
return resource;
}

View File

@ -1,5 +1,6 @@
import type { Config } from "vike/types"; import type { Config } from "vike/types";
import { buildPublicUrl } from "@/buildPublicUrl";
import Layout from "@/layouts/LayoutDefault"; import Layout from "@/layouts/LayoutDefault";
import vikeSolid from "vike-solid/config"; import vikeSolid from "vike-solid/config";
@ -25,7 +26,7 @@ export default {
class: "flex min-h-full bg-white", class: "flex min-h-full bg-white",
}, },
image: "/opengraph/og.png", image: buildPublicUrl("/opengraph/og.png"),
prerender: true, prerender: true,
prefetchStaticAssets: "hover", prefetchStaticAssets: "hover",