mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-15 07:26:48 +00:00
CONFIG-TABLE 提交首行代码
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user