mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-09 15:10:39 +00:00
加锁: 列表页文章预览
This commit is contained in:
@@ -32,6 +32,9 @@ export async function getStaticProps () {
|
|||||||
if (BLOG.POST_LIST_PREVIEW === 'true') {
|
if (BLOG.POST_LIST_PREVIEW === 'true') {
|
||||||
for (const i in postsToShow) {
|
for (const i in postsToShow) {
|
||||||
const post = postsToShow[i]
|
const post = postsToShow[i]
|
||||||
|
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) {
|
if (blockMap) {
|
||||||
post.blockMap = blockMap
|
post.blockMap = blockMap
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ export async function getStaticProps ({ params: { page } }) {
|
|||||||
if (BLOG.POST_LIST_PREVIEW === 'true') {
|
if (BLOG.POST_LIST_PREVIEW === 'true') {
|
||||||
for (const i in props.posts) {
|
for (const i in props.posts) {
|
||||||
const post = props.posts[i]
|
const post = props.posts[i]
|
||||||
|
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) {
|
if (blockMap) {
|
||||||
post.blockMap = blockMap
|
post.blockMap = blockMap
|
||||||
|
|||||||
Reference in New Issue
Block a user