Attempt to get active Netlify url as hostname

This commit is contained in:
Soitora 2023-09-01 12:33:38 +02:00
parent 77a423d8e0
commit 6f1a88bc00
No known key found for this signature in database
GPG Key ID: A6D711EB4F2CCD97
2 changed files with 10 additions and 3 deletions

View File

@ -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"

View File

@ -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,