From 6033d088901ba4709ed6d720c7844718cce4c175 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 8 Mar 2023 20:41:52 +0800 Subject: [PATCH] hexo-theme blog-card --- themes/hexo/components/BlogPostCard.js | 8 ++++---- themes/hexo/components/BlogPostListPage.js | 2 +- themes/hexo/components/BlogPostListScroll.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index c66ed5ff..1baa3d82 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -5,7 +5,7 @@ import TagItemMini from './TagItemMini' import CONFIG_HEXO from '../config_hexo' import NotionPage from '@/components/NotionPage' -const BlogPostCard = ({ post, showSummary, index, siteInfo }) => { +const BlogPostCard = ({ post, showSummary, siteInfo }) => { const showPreview = CONFIG_HEXO.POST_LIST_PREVIEW && post.blockMap if (post && !post.page_cover && CONFIG_HEXO.POST_LIST_COVER_DEFAULT) { post.page_cover = siteInfo?.pageCover @@ -19,9 +19,9 @@ const BlogPostCard = ({ post, showSummary, index, siteInfo }) => { data-aos-easing="ease-in-out" data-aos-once="true" data-aos-anchor-placement="top-bottom" - 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 `}> + className='flex md:flex-row flex-col-reverse even: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'>
{ {/* 文章列表 */}
{posts.map(post => ( - + ))}
{showPagination && } diff --git a/themes/hexo/components/BlogPostListScroll.js b/themes/hexo/components/BlogPostListScroll.js index a65eb4ee..569df9ae 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 => ( - + ))}