diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index f885f22b..6c01c294 100755 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -272,6 +272,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) { // 文章计数 let postCount = 0 + // 查找所有的Post和Page const allPages = collectionData.filter(post => { if (post?.type === 'Post' && post.status === 'Published') { @@ -282,6 +283,16 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) { (post?.status === 'Invisible' || post?.status === 'Published') }) + // 从notion中读取配置 + const configPage = collectionData.find(post => { + return post && post?.type && post?.type === 'CONFIG' + }) + + if (configPage) { + const config = await getPostBlocks(configPage.id, 'config-table') + console.log('配置中心', configPage, config) + } + // Sort by date if (BLOG.POSTS_SORT_BY === 'date') { allPages.sort((a, b) => {