mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 15:09:31 +00:00
32 lines
852 B
JavaScript
32 lines
852 B
JavaScript
import BLOG from '@/blog.config'
|
|
import { siteConfig } from '@/lib/config'
|
|
import { getGlobalData } from '@/lib/db/getSiteData'
|
|
import { DynamicLayout } from '@/themes/theme'
|
|
import { useRouter } from 'next/router'
|
|
|
|
/**
|
|
* 分类首页
|
|
* @param {*} props
|
|
* @returns
|
|
*/
|
|
export default function Category(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 }) {
|
|
const props = await getGlobalData({ from: 'category-index-props', locale })
|
|
delete props.allPages
|
|
return {
|
|
props,
|
|
revalidate: process.env.EXPORT
|
|
? undefined
|
|
: siteConfig(
|
|
'NEXT_REVALIDATE_SECOND',
|
|
BLOG.NEXT_REVALIDATE_SECOND,
|
|
props.NOTION_CONFIG
|
|
)
|
|
}
|
|
}
|