hexo-theme blog-card

This commit is contained in:
tangly1024
2023-03-08 20:41:52 +08:00
parent 556c518ea7
commit 6033d08890
3 changed files with 6 additions and 6 deletions

View File

@@ -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'>
<div className={`lg:p-8 p-4 flex flex-col ${showPageCover ? 'md:w-7/12 w-full' : 'w-full'}`}>
<Link

View File

@@ -22,7 +22,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
{/* 文章列表 */}
<div className="space-y-6 px-2">
{posts.map(post => (
<BlogPostCard key={post.id} post={post} index={posts.indexOf(post)} siteInfo={siteInfo}/>
<BlogPostCard key={post.id} post={post} siteInfo={siteInfo}/>
))}
</div>
{showPagination && <PaginationNumber page={page} totalPage={totalPage} />}

View File

@@ -58,7 +58,7 @@ const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG_HE
{/* 文章列表 */}
<div className='flex flex-wrap space-y-1 lg:space-y-4 px-2'>
{postsToShow.map(post => (
<BlogPostCard key={post.id} post={post} index={posts.indexOf(post)} showSummary={showSummary} siteInfo={siteInfo}/>
<BlogPostCard key={post.id} post={post} showSummary={showSummary} siteInfo={siteInfo}/>
))}
</div>