mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-08 07:26:47 +00:00
Add facebook Open Graph Url and image. Fix PATH env conflict with Vercel environment
This commit is contained in:
@@ -3,19 +3,21 @@ import { getPostBlocks } from '@/lib/notion'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import * as ThemeMap from '@/themes'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
const Index = (props) => {
|
||||
const Index = props => {
|
||||
const { theme } = useGlobal()
|
||||
const ThemeComponents = ThemeMap[theme]
|
||||
return <ThemeComponents.LayoutIndex {...props}/>
|
||||
return <ThemeComponents.LayoutIndex {...props} />
|
||||
}
|
||||
|
||||
export async function getStaticProps () {
|
||||
export async function getStaticProps() {
|
||||
const from = 'index'
|
||||
const props = await getGlobalNotionData({ from, pageType: ['Post'] })
|
||||
const { allPosts, siteInfo } = props
|
||||
const meta = {
|
||||
title: `${siteInfo.title} | ${siteInfo.description}`,
|
||||
description: siteInfo.description,
|
||||
image: siteInfo.pageCover,
|
||||
slug: '',
|
||||
type: 'website'
|
||||
}
|
||||
|
||||
@@ -35,7 +37,11 @@ export async function getStaticProps () {
|
||||
if (post.password && post.password !== '') {
|
||||
continue
|
||||
}
|
||||
const blockMap = await getPostBlocks(post.id, 'slug', BLOG.POST_PREVIEW_LINES)
|
||||
const blockMap = await getPostBlocks(
|
||||
post.id,
|
||||
'slug',
|
||||
BLOG.POST_PREVIEW_LINES
|
||||
)
|
||||
if (blockMap) {
|
||||
post.blockMap = blockMap
|
||||
}
|
||||
@@ -46,7 +52,8 @@ export async function getStaticProps () {
|
||||
|
||||
return {
|
||||
props: {
|
||||
meta, ...props
|
||||
meta,
|
||||
...props
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user