Skip to content

Commit 18916e4

Browse files
committed
CONFIG-TABLE 提交首行代码
1 parent fd29df3 commit 18916e4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/notion/getNotionData.js

+11
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
272272

273273
// 文章计数
274274
let postCount = 0
275+
275276
// 查找所有的Post和Page
276277
const allPages = collectionData.filter(post => {
277278
if (post?.type === 'Post' && post.status === 'Published') {
@@ -282,6 +283,16 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
282283
(post?.status === 'Invisible' || post?.status === 'Published')
283284
})
284285

286+
// 从notion中读取配置
287+
const configPage = collectionData.find(post => {
288+
return post && post?.type && post?.type === 'CONFIG'
289+
})
290+
291+
if (configPage) {
292+
const config = await getPostBlocks(configPage.id, 'config-table')
293+
console.log('配置中心', configPage, config)
294+
}
295+
285296
// Sort by date
286297
if (BLOG.POSTS_SORT_BY === 'date') {
287298
allPages.sort((a, b) => {

0 commit comments

Comments
 (0)