mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-16 07:26:47 +00:00
feature:最新文章排序调整,适配夜间模式
This commit is contained in:
@@ -48,10 +48,12 @@ async function getPostsFromNotionAPI ({ from }) {
|
||||
for (let i = 0; i < pageIds.length; i++) {
|
||||
const id = pageIds[i]
|
||||
const properties = (await getPageProperties(id, block, schema)) || null
|
||||
// Add fullwidth, createdtime to properties
|
||||
properties.createdTime = new Date(
|
||||
block[id].value?.created_time
|
||||
).toString()
|
||||
properties.lastEditedTime = new Date(
|
||||
block[id].value?.last_edited_time
|
||||
).toString()
|
||||
properties.fullWidth = block[id].value?.format?.page_full_width ?? false
|
||||
properties.page_cover = getPostCover(id, block, pageRecordMap) ?? getContentFirstImage(id, block, pageRecordMap)
|
||||
properties.content = block[id].value?.content ?? []
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import { NotionAPI } from 'notion-client'
|
||||
import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
export async function getPostBlocks (id, from) {
|
||||
let pageBlock = await getDataFromCache('page_block_' + id)
|
||||
|
||||
Reference in New Issue
Block a user