图片懒加载组件,优化性能,优化SEO

This commit is contained in:
tangly1024.com
2023-07-21 11:46:31 +08:00
parent 0637af15ad
commit 0aecf06729
40 changed files with 179 additions and 104 deletions

View File

@@ -7,6 +7,7 @@ import CONFIG from '../config'
import CategoryItem from './CategoryItem'
import TagItemMini from './TagItemMini'
import TwikooCommentCount from '@/components/TwikooCommentCount'
import LazyImage from '@/components/LazyImage'
const BlogPostCard = ({ post, showSummary }) => {
const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap
@@ -30,8 +31,7 @@ const BlogPostCard = ({ post, showSummary }) => {
}>
<div>
{CONFIG.POST_LIST_COVER && <div className='w-full max-h-96 object-cover overflow-hidden mb-2'>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={post.pageCoverThumbnail} className='w-full max-h-96 object-cover hover:scale-125 duration-150' />
<LazyImage src={post.pageCoverThumbnail} className='w-full max-h-96 object-cover hover:scale-125 duration-150' />
</div>}
{post.title}
</div>