Files
NotionNext/pages/category/index.js
2022-03-03 21:28:08 +08:00

26 lines
644 B
JavaScript

import { getGlobalNotionData } from '@/lib/notion/getNotionData'
import React from 'react'
import { useGlobal } from '@/lib/global'
export default function Category (props) {
const { ThemeComponents } = useGlobal()
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
}
}