mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
移除404,测试编译
This commit is contained in:
16
pages/404.js
16
pages/404.js
@@ -1,16 +0,0 @@
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import * as ThemeMap from '@/themes'
|
||||
|
||||
/**
|
||||
* 自定义404界面
|
||||
* @returns {JSX.Element}
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
const Custom404 = (props) => {
|
||||
const { theme } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
return <ThemeComponents.Layout404 {...props}/>
|
||||
}
|
||||
|
||||
export default Custom404
|
||||
@@ -2,7 +2,6 @@ import BLOG from '@/blog.config'
|
||||
import { getPostBlocks } from '@/lib/notion'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import Custom404 from './404'
|
||||
import * as ThemeMap from '@/themes'
|
||||
|
||||
/**
|
||||
@@ -14,7 +13,7 @@ const Slug = (props) => {
|
||||
const { theme } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
if (!props.post) {
|
||||
return <Custom404 {...props} />
|
||||
return <ThemeComponents.Layout404 {...props}/>
|
||||
}
|
||||
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={false}/>
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import BLOG from '@/blog.config'
|
||||
import { getPostBlocks } from '@/lib/notion'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import Custom404 from '../404'
|
||||
import * as ThemeMap from '@/themes'
|
||||
|
||||
/**
|
||||
@@ -14,7 +13,7 @@ const Slug = (props) => {
|
||||
const { theme } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
if (!props.post) {
|
||||
return <Custom404 {...props} />
|
||||
return <ThemeComponents.Layout404 {...props}/>
|
||||
}
|
||||
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true}/>
|
||||
}
|
||||
|
||||
@@ -2,14 +2,13 @@ import BLOG from '@/blog.config'
|
||||
import { getPostBlocks } from '@/lib/notion'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import Custom404 from '../404'
|
||||
import * as ThemeMap from '@/themes'
|
||||
|
||||
const Page = (props) => {
|
||||
const { theme } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
if (!props?.meta) {
|
||||
return <Custom404 {...props} />
|
||||
return <ThemeComponents.Layout404 {...props}/>
|
||||
}
|
||||
return <ThemeComponents.LayoutPage {...props} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user