mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 23:16:49 +00:00
fix-config
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
import { getDateValue, getTextContent } from 'notion-utils'
|
||||
import { getPostBlocks } from './getPostBlocks'
|
||||
import getAllPageIds from './getAllPageIds'
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
/**
|
||||
* 从Notion中读取Config配置表
|
||||
@@ -18,7 +17,7 @@ import BLOG from '@/blog.config'
|
||||
*/
|
||||
export async function getConfigMapFromConfigPage(allPages) {
|
||||
// 默认返回配置文件
|
||||
const notionConfig = BLOG
|
||||
const notionConfig = {}
|
||||
|
||||
if (!allPages || !Array.isArray(allPages) || allPages.length === 0) {
|
||||
console.warn('[Notion配置] 忽略的配置')
|
||||
|
||||
@@ -285,7 +285,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
|
||||
})
|
||||
|
||||
// 站点配置优先读取配置表格,否则读取blog.config.js 文件
|
||||
const NOTION_CONFIG = await getConfigMapFromConfigPage(collectionData) || BLOG
|
||||
const NOTION_CONFIG = await getConfigMapFromConfigPage(collectionData) || {}
|
||||
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
|
||||
Reference in New Issue
Block a user