fix(docs): improve base path handling for vercel and github pages

Use withBase helper from vitepress to handle base paths consistently
Simplify vercel environment detection logic in config
This commit is contained in:
sanbuphy
2026-01-13 23:03:43 +08:00
parent 4c25317b86
commit 3ffdae8c1b
2 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import { defineConfig } from 'vitepress'
// 判断是否是 Vercel 环境, github page 和 vercel 的部署地址相关不一样
const isVercel = process.env.VERCEL === '1'
const base = isVercel ? '/' : '/easy-vibe/'
const isVercel = process.env.VERCEL === '1' || !!process.env.VERCEL_URL
const base = process.env.BASE || (isVercel ? '/' : '/easy-vibe/')
// 语言映射配置
const localeMap = {