og:image完善

This commit is contained in:
tlyong1992
2022-05-18 14:21:13 +08:00
parent a3f2494f56
commit 0c844c4986
12 changed files with 14 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ import { useRouter } from 'next/router'
const Slug = props => {
const { theme, changeLoadingState } = useGlobal()
const ThemeComponents = ThemeMap[theme]
const { post } = props
const { post, siteInfo } = props
if (!post) {
changeLoadingState(true)
@@ -30,7 +30,7 @@ const Slug = props => {
}
}
}, 10000)
const meta = { title: `${props?.siteInfo?.title || BLOG.TITLE} | loading` }
const meta = { title: `${props?.siteInfo?.title || BLOG.TITLE} | loading`, image: siteInfo?.pageCover }
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true} meta={meta} />
}
@@ -58,7 +58,6 @@ const Slug = props => {
props = { ...props, lock, setLock, validPassword }
const { siteInfo } = props
const meta = {
title: `${post?.title} | ${siteInfo?.title}`,
description: post?.summary,