Update config.ts

This commit is contained in:
Vaica committed 2026-06-21 22:50:26 +08:00
1 parent f73e57ddfe
commit 62dbbdcae3
1 file changed
+4 -3
+4 -3
View File
@@ -2,9 +2,10 @@ import path from "path";
import os from "os";
// 支持环境变量配置 BLOG_ROOT(Linux 部署)
// Docker 部署时,BLOG_ROOT 通过环境变量传入
export const BLOG_ROOT = process.env.BLOG_ROOT
? path.resolve(process.env.BLOG_ROOT)
// Docker 部署时,BLOG_ROOT 通过 Docker 环境变量传入,不要放在 .env 文件中
const envBlogRoot = process.env.BLOG_ROOT;
export const BLOG_ROOT = envBlogRoot && envBlogRoot.trim()
? path.resolve(envBlogRoot)
: path.resolve(process.cwd(), "..");
export const CONTENT_DIR = path.join(BLOG_ROOT, "content", "posts");