CONFIG-TABLE 提交首行代码

This commit is contained in:
tangly1024
2023-10-29 22:45:37 +08:00
parent fd29df3b26
commit 18916e448f

View File

@@ -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) => {