mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-16 23:16:48 +00:00
28 lines
713 B
JavaScript
28 lines
713 B
JavaScript
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
|
import React from 'react'
|
|
import { useGlobal } from '@/lib/global'
|
|
import * as ThemeMap from '@/themes'
|
|
|
|
export default function Category (props) {
|
|
const { theme } = useGlobal()
|
|
const ThemeComponents = ThemeMap[theme]
|
|
return <ThemeComponents.LayoutCategoryIndex {...props}/>
|
|
}
|
|
|
|
export async function getStaticProps () {
|
|
const from = 'category-index-props'
|
|
const { allPosts, categories, tags, postCount, latestPosts, customNav } = await getGlobalNotionData({ from, categoryCount: 0 })
|
|
|
|
return {
|
|
props: {
|
|
tags,
|
|
allPosts,
|
|
categories,
|
|
postCount,
|
|
latestPosts,
|
|
customNav
|
|
},
|
|
revalidate: 1
|
|
}
|
|
}
|