预览文章溢出

This commit is contained in:
tangly1024
2022-01-11 16:47:56 +08:00
parent f3f7fc7fcc
commit 2ce88eef04
3 changed files with 17 additions and 18 deletions

View File

@@ -43,27 +43,28 @@ const BlogPostCard = ({ post, showSummary }) => {
{post.summary} {post.summary}
</p>} </p>}
{showPreview && post?.blockMap && <div className='max-h-screen overflow-hidden truncate max-w-full'> {showPreview && post?.blockMap && <div className='max-h-screen overflow-ellipsis truncate max-w-full'>
<NotionRenderer <NotionRenderer
recordMap={post.blockMap} bodyClassName='max-h-full'
mapPageUrl={mapPageUrl} recordMap={post.blockMap}
components={{ mapPageUrl={mapPageUrl}
equation: Equation, components={{
code: Code, equation: Equation,
collectionRow: CollectionRow, code: Code,
collection: Collection collectionRow: CollectionRow,
}} collection: Collection
/> }}
/>
</div> } </div> }
<div className='border-b-2 w-full border-dashed py-2'></div> <div className='border-b-2 w-full border-dashed py-2'></div>
<Link href={`${BLOG.path}/article/${post.slug}`} passHref> <div className='flex items-center pt-6 justify-end leading-tight'>
<div className='flex items-center cursor-pointer pt-6 justify-end leading-tight'> <Link href={`${BLOG.path}/article/${post.slug}`} passHref>
<a className='bg-black p-2 text-white'>{locale.COMMON.ARTICLE_DETAIL} <a className='bg-black p-2 text-white cursor-pointer'>{locale.COMMON.ARTICLE_DETAIL}
<FontAwesomeIcon icon={faAngleDoubleRight} /></a> <FontAwesomeIcon icon={faAngleDoubleRight} /></a>
</div> </Link>
</Link> </div>
</div> </div>
{BLOG.home?.showPostCover && post?.page_cover && ( {BLOG.home?.showPostCover && post?.page_cover && (

View File

@@ -33,7 +33,6 @@ export async function getStaticProps () {
post.blockMap = blockMap post.blockMap = blockMap
} }
} }
console.log('加载文章预览完成')
} }
return { return {

View File

@@ -59,7 +59,6 @@ export async function getStaticProps ({ params: { page } }) {
post.blockMap = blockMap post.blockMap = blockMap
} }
} }
console.log('加载文章预览完成')
return { return {
props: { props: {