From d926c726b5f06a1d4a0c8804ed2ec46f10fd2c99 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 12 Jan 2022 11:10:21 +0800 Subject: [PATCH] =?UTF-8?q?feature=EF=BC=9A=20=E6=96=B0=E5=A2=9E=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E9=A2=84=E8=A7=88=E8=A1=8C=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 1 + pages/index.js | 2 +- pages/page/[page].js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blog.config.js b/blog.config.js index f4c9ab67..2103e7c4 100644 --- a/blog.config.js +++ b/blog.config.js @@ -12,6 +12,7 @@ const BLOG = { homeBannerImage: './bg_image.jpg', // 背景图地址 showPostCover: false, // 文章列表显示封面图 showPreview: true, // 列表展示文章预览 + previewLines: 12, // 预览文章的篇幅 showSummary: false // 显示用户自定义摘要 }, lang: 'zh-CN', // ['zh-CN','en-US'] default lang => see /lib/lang.js for more. diff --git a/pages/index.js b/pages/index.js index 4da207d9..3b05aff4 100644 --- a/pages/index.js +++ b/pages/index.js @@ -28,7 +28,7 @@ export async function getStaticProps () { ) for (const i in postsToShow) { const post = postsToShow[i] - const blockMap = await getPostBlocks(post.id, 'slug', 12) + const blockMap = await getPostBlocks(post.id, 'slug', BLOG.home.previewLines) if (blockMap) { post.blockMap = blockMap } diff --git a/pages/page/[page].js b/pages/page/[page].js index 274a283d..a91e80a2 100644 --- a/pages/page/[page].js +++ b/pages/page/[page].js @@ -54,7 +54,7 @@ export async function getStaticProps ({ params: { page } }) { for (const i in postsToShow) { const post = postsToShow[i] - const blockMap = await getPostBlocks(post.id, 'slug', 12) + const blockMap = await getPostBlocks(post.id, 'slug', BLOG.home.previewLines) if (blockMap) { post.blockMap = blockMap }