mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 23:16:48 +00:00
Next主题可隐藏头图,并显示icon
This commit is contained in:
@@ -79,6 +79,7 @@ async function getPageProperties(id, block, schema, authToken, tagOptions, siteI
|
||||
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 => {
|
||||
@@ -97,4 +98,13 @@ async function getPageProperties(id, block, schema, authToken, tagOptions, siteI
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
export { getPageProperties as default }
|
||||
|
||||
Reference in New Issue
Block a user