mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-08 07:26:47 +00:00
站点信息读取Notion数据
This commit is contained in:
@@ -3,24 +3,24 @@ import React from 'react'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import * as ThemeMap from '@/themes'
|
||||
|
||||
const ArchiveIndex = (props) => {
|
||||
const { theme } = useGlobal()
|
||||
const ArchiveIndex = props => {
|
||||
const { theme, locale } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
return <ThemeComponents.LayoutArchive {...props}/>
|
||||
const { siteInfo } = props
|
||||
const meta = {
|
||||
title: `${locale.NAV.ARCHIVE} | ${siteInfo.title}`,
|
||||
description: siteInfo.description,
|
||||
type: 'website'
|
||||
}
|
||||
|
||||
return <ThemeComponents.LayoutArchive {...props} meta={meta}/>
|
||||
}
|
||||
|
||||
export async function getStaticProps () {
|
||||
const { allPosts, categories, tags, postCount, customNav } =
|
||||
await getGlobalNotionData({ from: 'archive-index' })
|
||||
|
||||
const props = await getGlobalNotionData({ from: 'archive-index' })
|
||||
props.posts = props.allPosts
|
||||
return {
|
||||
props: {
|
||||
posts: allPosts,
|
||||
tags,
|
||||
categories,
|
||||
postCount,
|
||||
customNav
|
||||
},
|
||||
props,
|
||||
revalidate: 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user