Merge pull request #138 from yuzhanglong/patch-1

fix: fix build error for no title or description
This commit is contained in:
tangly1024
2022-04-02 09:40:03 +08:00
committed by GitHub

View File

@@ -157,8 +157,8 @@ async function getBlogInfo ({ notionPageData, from }) {
return null
}
const collection = notionPageData?.collection
const title = collection?.name[0][0] || BLOG.TITLE
const description = collection?.description[0][0] || BLOG.DESCRIPTION
const title = collection?.name?.[0][0] || BLOG.TITLE
const description = collection?.description?.[0][0] || BLOG.DESCRIPTION
const pageCover = mapCoverUrl(collection?.cover, notionPageData.block)
return { title, description, pageCover }
}