加锁: 列表页文章预览

This commit is contained in:
tangly1024
2022-04-02 12:31:51 +08:00
parent 5b5e72478c
commit 7795979ebc
2 changed files with 6 additions and 0 deletions

View File

@@ -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