mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-21 07:26:49 +00:00
Merge branch 'feat/next-theme-header-img' into develop
This commit is contained in:
@@ -79,6 +79,7 @@ export default async function getPageProperties(id, block, schema, authToken, ta
|
||||
properties.createdTime = formatDate(new Date(value.created_time).toString(), BLOG.LANG)
|
||||
properties.lastEditedTime = formatDate(new Date(value?.last_edited_time).toString(), BLOG.LANG)
|
||||
properties.fullWidth = value.format?.page_full_width ?? false
|
||||
properties.pageIcon = getPageIcon(id, block) ?? ''
|
||||
properties.page_cover = getPostCover(id, block) ?? siteInfo?.pageCover
|
||||
properties.content = value.content ?? []
|
||||
properties.tagItems = properties?.tags?.map(tag => {
|
||||
@@ -96,3 +97,12 @@ export default async function getPageProperties(id, block, schema, authToken, ta
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getPageIcon(id, block) {
|
||||
const pageIcon = block[id].value?.format?.page_icon
|
||||
if (pageIcon) {
|
||||
if (pageIcon.startsWith('/')) return 'https://www.notion.so' + pageIcon
|
||||
if (pageIcon.startsWith('http')) return defaultMapImageUrl(pageIcon, block[id].value)
|
||||
return pageIcon
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user