From ce43491e2e97ac1b00a459e4ee49a658f000fc8c Mon Sep 17 00:00:00 2001 From: gbanyan Date: Wed, 19 Nov 2025 02:03:49 +0800 Subject: [PATCH] Switch card images to next/image --- components/post-card.tsx | 8 +++++--- components/post-list-item.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/post-card.tsx b/components/post-card.tsx index 70e3d54..be2fc5c 100644 --- a/components/post-card.tsx +++ b/components/post-card.tsx @@ -1,4 +1,5 @@ import Link from 'next/link'; +import Image from 'next/image'; import type { Post } from 'contentlayer/generated'; import { siteConfig } from '@/lib/config'; import { faCalendarDays, faTags } from '@fortawesome/free-solid-svg-icons'; @@ -19,11 +20,12 @@ export function PostCard({ post, showTags = true }: PostCardProps) {
{cover && ( -
- {/* eslint-disable-next-line @next/next/no-img-element */} - + {post.title}
diff --git a/components/post-list-item.tsx b/components/post-list-item.tsx index 8051a43..18a0e0b 100644 --- a/components/post-list-item.tsx +++ b/components/post-list-item.tsx @@ -1,4 +1,5 @@ import Link from 'next/link'; +import Image from 'next/image'; import type { Post } from 'contentlayer/generated'; import { siteConfig } from '@/lib/config'; import { faCalendarDays, faTags } from '@fortawesome/free-solid-svg-icons'; @@ -21,11 +22,12 @@ export function PostListItem({ post }: Props) {
{cover && ( -
- {/* eslint-disable-next-line @next/next/no-img-element */} - + {post.title}