修复404跳转bug

This commit is contained in:
tangly1024
2022-04-13 13:05:20 +08:00
parent b122bab41d
commit f1a29575bd
14 changed files with 78 additions and 37 deletions

View File

@@ -26,6 +26,9 @@ const GiscusComponent = dynamic(
)
const Comment = ({ frontMatter }) => {
if (!frontMatter) {
return <>Loading...</>
}
const router = useRouter()
const { locale, isDarkMode } = useGlobal()
return (

View File

@@ -37,6 +37,10 @@ const Modal = dynamic(
}
)
const NotionPage = ({ post }) => {
if (!post || !post.blockMap) {
return <>Loading...</>
}
const zoom = typeof window !== 'undefined' && mediumZoom({
container: '.notion-viewport',
background: 'rgba(0, 0, 0, 0.2)',
@@ -57,16 +61,18 @@ const NotionPage = ({ post }) => {
}
}, [router.events])
return <NotionRenderer
recordMap={post.blockMap}
mapPageUrl={mapPageUrl}
components={{
Code,
Collection,
Equation,
Modal,
Pdf
}} />
return <div id='container'>
<NotionRenderer
recordMap={post.blockMap}
mapPageUrl={mapPageUrl}
components={{
Code,
Collection,
Equation,
Modal,
Pdf
}} />
</div>
}
const mapPageUrl = id => {