整理修改

This commit is contained in:
tangly1024.com
2023-11-02 14:10:46 +08:00
parent a6cc5a11f3
commit 5ccf8823a6
34 changed files with 101 additions and 80 deletions

View File

@@ -2,6 +2,7 @@
import BLOG from '@/blog.config'
import { useGlobal } from './global'
import { deepClone } from './utils'
/**
* 读取配置
@@ -47,6 +48,23 @@ export const siteConfig = (key) => {
if (!val) {
val = BLOG[key]
}
console.log('实际配置', key, val)
// console.log('实际配置', key, val)
return val
}
/**
* 读取所有配置
* 1. 优先读取NotionConfig表
* 2. 其次读取环境变量
* 3. 再读取blog.config.js文件
* @param {*} key
* @returns
*/
export const siteConfigMap = () => {
const val = deepClone(BLOG)
for (const key in val) {
val[key] = siteConfig(key)
console.log('site', key, val[key], siteConfig(key))
}
return val
}