mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-15 07:26:48 +00:00
32 lines
810 B
JavaScript
32 lines
810 B
JavaScript
import BLOG from '@/blog.config'
|
|
import { siteConfig } from '@/lib/config'
|
|
import { getGlobalData } from '@/lib/db/getSiteData'
|
|
import { DynamicLayout } from '@/themes/theme'
|
|
|
|
/**
|
|
* 分类首页
|
|
* @param {*} props
|
|
* @returns
|
|
*/
|
|
export default function Category(props) {
|
|
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
|
|
return (
|
|
<DynamicLayout theme={theme} layoutName='LayoutCategoryIndex' {...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
|
|
)
|
|
}
|
|
}
|