Merge pull request #141 from tangly1024/preview

Preview
This commit is contained in:
tangly1024
2022-04-02 12:42:42 +08:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ export async function getStaticProps () {
const props = await getGlobalNotionData({ from, pageType: ['Post'] })
const { allPosts, siteInfo } = props
const meta = {
title: `${siteInfo.title}`,
title: `${siteInfo.title} | ${siteInfo.description}`,
description: siteInfo.description,
type: 'website'
}
@@ -32,6 +32,9 @@ export async function getStaticProps () {
if (BLOG.POST_LIST_PREVIEW === 'true') {
for (const i in postsToShow) {
const post = postsToShow[i]
if (post.password && post.password !== '') {
continue
}
const blockMap = await getPostBlocks(post.id, 'slug', BLOG.POST_PREVIEW_LINES)
if (blockMap) {
post.blockMap = blockMap

View File

@@ -42,6 +42,9 @@ export async function getStaticProps ({ params: { page } }) {
if (BLOG.POST_LIST_PREVIEW === 'true') {
for (const i in props.posts) {
const post = props.posts[i]
if (post.password && post.password !== '') {
continue
}
const blockMap = await getPostBlocks(post.id, 'slug', BLOG.POST_PREVIEW_LINES)
if (blockMap) {
post.blockMap = blockMap