mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 07:26:46 +00:00
Add facebook Open Graph Url and image. Fix PATH env conflict with Vercel environment
This commit is contained in:
@@ -14,23 +14,26 @@ const Page = props => {
|
||||
const meta = {
|
||||
title: `${props.page} | Page | ${siteInfo.title}`,
|
||||
description: siteInfo.description,
|
||||
slug: 'page/' + props.page,
|
||||
type: 'website'
|
||||
}
|
||||
return <ThemeComponents.LayoutPage {...props} meta={meta} />
|
||||
}
|
||||
|
||||
export async function getStaticPaths () {
|
||||
export async function getStaticPaths() {
|
||||
const from = 'page-paths'
|
||||
const { postCount } = await getGlobalNotionData({ from })
|
||||
const totalPages = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
|
||||
return {
|
||||
// remove first page, we 're not gonna handle that.
|
||||
paths: Array.from({ length: totalPages - 1 }, (_, i) => ({ params: { page: '' + (i + 2) } })),
|
||||
paths: Array.from({ length: totalPages - 1 }, (_, i) => ({
|
||||
params: { page: '' + (i + 2) }
|
||||
})),
|
||||
fallback: true
|
||||
}
|
||||
}
|
||||
|
||||
export async function getStaticProps ({ params: { page } }) {
|
||||
export async function getStaticProps({ params: { page } }) {
|
||||
const from = `page-${page}`
|
||||
const props = await getGlobalNotionData({ from })
|
||||
props.page = page
|
||||
@@ -45,7 +48,11 @@ export async function getStaticProps ({ params: { page } }) {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user