mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
允许封面图为空
This commit is contained in:
@@ -4,8 +4,13 @@ import React from 'react'
|
||||
import TagItemMini from './TagItemMini'
|
||||
import CONFIG_MATERY from '../config_matery'
|
||||
|
||||
const BlogPostCard = ({ post, showSummary }) => {
|
||||
const BlogPostCard = ({ post, showSummary, siteInfo }) => {
|
||||
const showPreview = CONFIG_MATERY.POST_LIST_PREVIEW && post.blockMap
|
||||
// matery 主题默认强制显示图片
|
||||
if (post && !post.page_cover) {
|
||||
post.page_cover = siteInfo.pageCover
|
||||
}
|
||||
const showPageCover = CONFIG_MATERY.POST_LIST_COVER && !showPreview && post?.page_cover
|
||||
return (
|
||||
<div
|
||||
data-aos="zoom-in"
|
||||
@@ -19,7 +24,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
<div key={post.id} className="flex flex-col h-96 justify-between">
|
||||
|
||||
{/* 头部图片 填充卡片 */}
|
||||
{CONFIG_MATERY.POST_LIST_COVER && !showPreview && post?.page_cover && (
|
||||
{showPageCover && (
|
||||
<Link href={`${BLOG.SUB_PATH}/${post.slug}`} passHref legacyBehavior>
|
||||
<div className="flex flex-grow w-full relative duration-200 bg-black rounded-t-md cursor-pointer transform overflow-hidden">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
|
||||
Reference in New Issue
Block a user