mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
加锁: 列表页文章预览
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user