mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
动态组件模式调整
This commit is contained in:
11
pages/404.js
11
pages/404.js
@@ -1,6 +1,6 @@
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import { getGlobalData } from '@/lib/db/getSiteData'
|
||||
import { getLayoutByTheme } from '@/themes/theme'
|
||||
import { DynamicLayout } from '@/themes/theme'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
/**
|
||||
@@ -9,12 +9,9 @@ import { useRouter } from 'next/router'
|
||||
* @returns
|
||||
*/
|
||||
const NoFound = props => {
|
||||
// 根据页面路径加载不同Layout文件
|
||||
const Layout = getLayoutByTheme({
|
||||
theme: siteConfig('THEME'),
|
||||
router: useRouter()
|
||||
})
|
||||
return <Layout {...props} />
|
||||
const router = useRouter()
|
||||
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
|
||||
return <DynamicLayout theme={theme} router={router} {...props} />
|
||||
}
|
||||
|
||||
export async function getStaticProps(req) {
|
||||
|
||||
Reference in New Issue
Block a user