From 797bb445c988ab0edbc9188fb6845184ba11b51a Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 2 Feb 2023 13:13:54 +0800 Subject: [PATCH] =?UTF-8?q?hexo=E5=BE=AE=E8=B0=83=20=E5=A5=87=E5=81=B6?= =?UTF-8?q?=E5=8D=A1=E7=89=8C=E6=A0=B7=E5=BC=8F=E5=B7=AE=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/BlogPostCard.js | 43 ++++++++++---------- themes/hexo/components/BlogPostListPage.js | 2 +- themes/hexo/components/BlogPostListScroll.js | 2 +- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index df120154..ee679bcf 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -5,28 +5,29 @@ import TagItemMini from './TagItemMini' import CONFIG_HEXO from '../config_hexo' import NotionPage from '@/components/NotionPage' -const BlogPostCard = ({ post, showSummary }) => { +const BlogPostCard = ({ post, showSummary, index }) => { const showPreview = CONFIG_HEXO.POST_LIST_PREVIEW && post.blockMap + const showPageCover = CONFIG_HEXO.POST_LIST_COVER return (
-
-
+ className={`flex md:flex-row flex-col-reverse ${index % 2 === 0 ? 'md:flex-row-reverse' : ''} + w-full md:h-72 h-96 justify-between overflow-hidden drop-shadow-md + border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray `}> + +
+ } leading-tight text-gray-600 dark:text-gray-100 hover:text-indigo-700 dark:hover:text-indigo-400`}> - {post.title} + {post.title} {index % 2} @@ -88,20 +89,20 @@ const BlogPostCard = ({ post, showSummary }) => {
- {CONFIG_HEXO.POST_LIST_COVER && !showPreview && post?.page_cover && !post.results && ( - -
- {/* eslint-disable-next-line @next/next/no-img-element */} - {post.title} - {/* {post.title} */} + {showPageCover && !showPreview && post?.page_cover && !post.results && ( +
+ + {/* eslint-disable-next-line @next/next/no-img-element */} + {post.title} + {/* {post.title} */} +
- )} -
+
) } diff --git a/themes/hexo/components/BlogPostListPage.js b/themes/hexo/components/BlogPostListPage.js index 3662aee9..edbdfbb8 100644 --- a/themes/hexo/components/BlogPostListPage.js +++ b/themes/hexo/components/BlogPostListPage.js @@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => { {/* 文章列表 */}
{posts.map(post => ( - + ))}
{showPagination && } diff --git a/themes/hexo/components/BlogPostListScroll.js b/themes/hexo/components/BlogPostListScroll.js index ca6f705d..c846b83a 100644 --- a/themes/hexo/components/BlogPostListScroll.js +++ b/themes/hexo/components/BlogPostListScroll.js @@ -58,7 +58,7 @@ const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG_HE {/* 文章列表 */}
{postsToShow.map(post => ( - + ))}