mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 15:10:06 +00:00
部分配置siteConfig化
This commit is contained in:
@@ -69,7 +69,7 @@ export async function getConfigMapFromConfigPage(allPages) {
|
||||
console.error(`pageId "${configTableId}" is not a database`)
|
||||
return null
|
||||
}
|
||||
console.log('表格', databaseRecordMap, block, rawMetadata)
|
||||
// console.log('表格', databaseRecordMap, block, rawMetadata)
|
||||
const collectionId = rawMetadata?.collection_id
|
||||
const collection = pageRecordMap.collection[collectionId].value
|
||||
const collectionQuery = pageRecordMap.collection_query
|
||||
@@ -127,7 +127,7 @@ export async function getConfigMapFromConfigPage(allPages) {
|
||||
|
||||
// 只导入生效的配置
|
||||
if (config.enable) {
|
||||
console.log('[覆盖代码配置]', config.key)
|
||||
// console.log('[覆盖代码配置]', config.key)
|
||||
notionConfig[config.key] = config.value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
|
||||
})
|
||||
|
||||
// 站点配置优先读取配置表格,否则读取blog.config.js 文件
|
||||
const CONFIG = await getConfigMapFromConfigPage(collectionData) || BLOG
|
||||
const NOTION_CONFIG = await getConfigMapFromConfigPage(collectionData) || BLOG
|
||||
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
@@ -305,7 +305,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
|
||||
const allNavPages = getNavPages({ allPages })
|
||||
|
||||
return {
|
||||
CONFIG,
|
||||
NOTION_CONFIG,
|
||||
notice,
|
||||
siteInfo,
|
||||
allPages,
|
||||
|
||||
Reference in New Issue
Block a user