Files
NotionNext/pages/category/index.js
2024-12-02 14:01:18 +08:00

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
)
}
}