mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
feature: 新增配置项预览行数
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user