Merge branch 'main' into original-fix

This commit is contained in:
tangly1024
2025-01-01 15:49:15 +08:00
committed by GitHub
355 changed files with 16915 additions and 6775 deletions

View File

@@ -156,13 +156,14 @@ const LayoutPostList = props => {
const LayoutSlug = props => {
const { post, lock, validPassword } = props
const router = useRouter()
const waiting404 = siteConfig('POST_WAITING_TIME_FOR_404') * 1000
useEffect(() => {
// 404
if (!post) {
setTimeout(
() => {
if (isBrowser) {
const article = document.getElementById('notion-article')
const article = document.querySelector('#article-wrapper #notion-article')
if (!article) {
router.push('/404').then(() => {
console.warn('找不到页面', router.asPath)
@@ -170,7 +171,7 @@ const LayoutSlug = props => {
}
}
},
siteConfig('POST_WAITING_TIME_FOR_404') * 1000
waiting404
)
}
}, [post])
@@ -178,11 +179,13 @@ const LayoutSlug = props => {
<>
{lock ? (
<PostLock validPassword={validPassword} />
) : (
<div id='article-wrapper'>
) : post && (
<div>
<PostMeta post={post} />
<NotionPage post={post} />
<ShareBar post={post} />
<div id='article-wrapper'>
<NotionPage post={post} />
<ShareBar post={post} />
</div>
<Comment frontMatter={post} />
</div>
)}