diff --git a/styles/globals.css b/styles/globals.css
index 972618ab..fa1f8f5d 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -302,4 +302,12 @@ a.avatar-wrapper {
-webkit-line-clamp: 4;
overflow: hidden;
text-overflow: ellipsis;
+}
+
+.p-3-lines {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
\ No newline at end of file
diff --git a/themes/example/components/BlogListPage.js b/themes/example/components/BlogListPage.js
index c655df4a..c36ebca1 100644
--- a/themes/example/components/BlogListPage.js
+++ b/themes/example/components/BlogListPage.js
@@ -3,6 +3,7 @@ import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'
import Link from 'next/link'
+import CONFIG_EXAMPLE from '../config_example'
export const BlogListPage = props => {
const { page = 1, posts, postCount } = props
@@ -15,38 +16,50 @@ export const BlogListPage = props => {
const showNext = page < totalPage
const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '')
+ const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER
+
return (
-
+
{posts?.map(p => (
-
-
-
- {p.title}
-
-
+
+
+
+
+ {p.title}
+
+
-
+
-
- {p.summary}
-
- {/* 搜索结果 */}
- {p.results && (
-
- {p.results.map(r => (
- {r}
- ))}
+
+ {p.summary}
+ {/* 搜索结果 */}
+ {p.results && (
+
+ {p.results.map(r => (
+ {r}
+ ))}
+
+ )}
+
+ {/* 图片封面 */}
+ {showPageCover && (
+
)}
))}
diff --git a/themes/example/components/BlogListScroll.js b/themes/example/components/BlogListScroll.js
index b3d7f3f0..0949f4da 100644
--- a/themes/example/components/BlogListScroll.js
+++ b/themes/example/components/BlogListScroll.js
@@ -3,6 +3,7 @@ import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import React from 'react'
import throttle from 'lodash.throttle'
+import CONFIG_EXAMPLE from '../config_example'
export const BlogListScroll = props => {
const { posts } = props
@@ -43,30 +44,50 @@ export const BlogListScroll = props => {
}
})
+ const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER
+
return (
{postsToShow.map(p => (
-
-
-
- {p.title}
-
-
+
+
+
+
+ {p.title}
+
+
-
+
-
- {p.summary}
-
-
+
+ {p.summary}
+
+ {/* 搜索结果 */}
+ {p.results && (
+
+ {p.results.map(r => (
+ {r}
+ ))}
+
+ )}
+
+ {/* 图片封面 */}
+ {showPageCover && (
+
+ )}
+
))}