Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Nov 19, 2024
1 parent a5ee8f0 commit 9690d06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import BLOG from '@/blog.config'
import { useGlobal } from './global'
import { deepClone, isUrl } from './utils'

const getValue = (value, fallback) => (hasVal(value) ? fallback : value)
const hasVal = value => value !== undefined && value !== null

/**
* 读取配置顺序
* 1. 优先读取NotionConfig表
Expand All @@ -21,6 +18,8 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => {
if (!key) {
return null
}
const getValue = (value, fallback) => (hasVal(value) ? value : fallback)
const hasVal = value => value !== undefined && value !== null

// 特殊配置处理;以下配置只在服务端生效;而Global的NOTION_CONFIG仅限前端组件使用,因此需要从extendConfig中读取
switch (key) {
Expand Down

0 comments on commit 9690d06

Please sign in to comment.