import Link from 'next/link' import CONFIG from '../config' import TagItemMini from './TagItemMini' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' import NotionIcon from '@/components/NotionIcon' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { const showPreview = siteConfig('HEO_POST_LIST_PREVIEW', null, CONFIG) && post.blockMap if (post && !post.pageCoverThumbnail && siteConfig('HEO_POST_LIST_COVER_DEFAULT', null, CONFIG)) { post.pageCoverThumbnail = siteInfo?.pageCover } const showPageCover = siteConfig('HEO_POST_LIST_COVER', null, CONFIG) && post?.pageCoverThumbnail && !showPreview const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` return (
{/* 图片封面 */} {showPageCover && (
)} {/* 文字区块 */}
{/* 分类 */} {post?.category && } {/* 标题 */} {post.title}
{/* 摘要 */} {(!showPreview || showSummary) && (
{post.summary}
)}
{' '} {post.tagItems?.map(tag => ( ))}
) } export default BlogPostCard