mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 23:16:51 +00:00
video-size
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import { idToUuid } from 'notion-utils'
|
||||
import { defaultMapImageUrl } from 'react-notion-x'
|
||||
import formatDate from '../utils/formatDate'
|
||||
import { getPostBlocks } from './getPostBlocks'
|
||||
import { defaultMapImageUrl } from 'react-notion-x'
|
||||
|
||||
/**
|
||||
* 根据页面ID获取内容
|
||||
@@ -23,11 +23,22 @@ export async function getPost(pageId) {
|
||||
tags: [],
|
||||
title: postInfo?.properties?.title?.[0],
|
||||
status: 'Published',
|
||||
createdTime: formatDate(new Date(postInfo.created_time).toString(), BLOG.LANG),
|
||||
lastEditedDay: formatDate(new Date(postInfo?.last_edited_time).toString(), BLOG.LANG),
|
||||
fullWidth: postInfo?.fullWidth,
|
||||
page_cover: getPageCover(postInfo),
|
||||
date: { start_date: formatDate(new Date(postInfo?.last_edited_time).toString(), BLOG.LANG) },
|
||||
createdTime: formatDate(
|
||||
new Date(postInfo.created_time).toString(),
|
||||
BLOG.LANG
|
||||
),
|
||||
lastEditedDay: formatDate(
|
||||
new Date(postInfo?.last_edited_time).toString(),
|
||||
BLOG.LANG
|
||||
),
|
||||
fullWidth: postInfo?.fullWidth || false,
|
||||
page_cover: getPageCover(postInfo) || BLOG.HOME_BANNER_IMAGE,
|
||||
date: {
|
||||
start_date: formatDate(
|
||||
new Date(postInfo?.last_edited_time).toString(),
|
||||
BLOG.LANG
|
||||
)
|
||||
},
|
||||
blockMap
|
||||
}
|
||||
}
|
||||
@@ -36,6 +47,7 @@ function getPageCover(postInfo) {
|
||||
const pageCover = postInfo.format?.page_cover
|
||||
if (pageCover) {
|
||||
if (pageCover.startsWith('/')) return BLOG.NOTION_HOST + pageCover
|
||||
if (pageCover.startsWith('http')) return defaultMapImageUrl(pageCover, postInfo)
|
||||
if (pageCover.startsWith('http'))
|
||||
return defaultMapImageUrl(pageCover, postInfo)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user