mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 23:16:52 +00:00
动态组件模式调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import BLOG from '@/blog.config'
|
||||
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'
|
||||
|
||||
/**
|
||||
@@ -10,13 +10,9 @@ import { useRouter } from 'next/router'
|
||||
* @returns
|
||||
*/
|
||||
export default function Category(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({ params: { category }, locale }) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BLOG from '@/blog.config'
|
||||
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'
|
||||
|
||||
/**
|
||||
@@ -11,13 +11,9 @@ import { useRouter } from 'next/router'
|
||||
*/
|
||||
|
||||
export default function Category(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({ params: { category, page } }) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BLOG from '@/blog.config'
|
||||
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'
|
||||
|
||||
/**
|
||||
@@ -10,13 +10,9 @@ import { useRouter } from 'next/router'
|
||||
* @returns
|
||||
*/
|
||||
export default function Category(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({ locale }) {
|
||||
|
||||
Reference in New Issue
Block a user