站点信息读取Notion数据

This commit is contained in:
tangly1024
2022-03-30 15:34:25 +08:00
parent 914e9a108f
commit 53c004843e
61 changed files with 322 additions and 463 deletions

View File

@@ -11,10 +11,11 @@ const Index = (props) => {
export async function getStaticProps () {
const from = 'index'
const { allPosts, latestPosts, categories, tags, postCount, customNav } = await getGlobalNotionData({ from, pageType: ['Post'] })
const props = await getGlobalNotionData({ from, pageType: ['Post'] })
const { allPosts, siteInfo } = props
const meta = {
title: `${BLOG.TITLE}`,
description: BLOG.DESCRIPTION,
title: `${siteInfo.title}`,
description: siteInfo.description,
type: 'website'
}
@@ -38,16 +39,11 @@ export async function getStaticProps () {
}
}
}
props.posts = postsToShow
return {
props: {
posts: postsToShow,
latestPosts,
postCount,
tags,
categories,
meta,
customNav
meta, ...props
},
revalidate: 1
}