diff --git a/netlify.toml b/netlify.toml index f709ef63..9ed15c18 100644 --- a/netlify.toml +++ b/netlify.toml @@ -4,4 +4,9 @@ [build] base = "website" publish = "src/.vitepress/dist" - command = "pnpm build" + +[context.production] + command = "VITE_HOSTNAME=$URL pnpm build" + +[context.deploy-preview] + command = "VITE_HOSTNAME=$DEPLOY_PRIME_URL pnpm build" \ No newline at end of file diff --git a/website/src/.vitepress/config.ts b/website/src/.vitepress/config.ts index 2f1643a6..31cba279 100644 --- a/website/src/.vitepress/config.ts +++ b/website/src/.vitepress/config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from "vitepress"; +import { defineConfig, loadEnv } from "vitepress"; import markdownConfig from "./config/markdownConfig"; // For use with loading Markdown plugins import themeConfig from "./config/themeConfig"; // Theme related config @@ -10,7 +10,9 @@ import generateOgImages from "./config/hooks/generateOgImages"; const title = "Tachiyomi"; const description = "Read your favorite manga, webtoons, comics, and more – easier than ever on your Android."; -const hostname: string = "https://kodo.moe"; + +const env = loadEnv("", process.cwd()) +const hostname: string = env.VITE_HOSTNAME || "http://localhost:4173"; export default defineConfig({ lastUpdated: true,