feat: change all Link component to SmartLink

Close #3512
This commit is contained in:
anime
2025-07-24 15:06:39 +08:00
parent fc4817e669
commit ba951cd2aa
338 changed files with 1381 additions and 1381 deletions

View File

@@ -1,6 +1,6 @@
import LazyImage from '@/components/LazyImage'
import { siteConfig } from '@/lib/config'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import CONFIG from '../config'
import TagItemMini from './TagItemMini'
@@ -44,12 +44,12 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => {
{/* 图片封面 */}
{showPageCover && (
<div>
<Link href={post?.href} passHref legacyBehavior>
<SmartLink href={post?.href} passHref legacyBehavior>
<LazyImage
className={'rounded-xl bg-center bg-cover w-40 h-24'}
src={post?.pageCoverThumbnail}
/>
</Link>
</SmartLink>
</div>
)}
@@ -60,24 +60,24 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => {
{post?.category && (
<div
className={`flex items-center ${showPreview ? 'justify-center' : 'justify-start'} hidden md:block flex-wrap dark:text-gray-500 text-gray-600 `}>
<Link
<SmartLink
passHref
href={`/category/${post.category}`}
className='cursor-pointer text-xs font-normal menu-link hover:text-indigo-700 dark:text-gray-600 transform'>
{post.category}
</Link>
</SmartLink>
</div>
)}
{/* 标题 */}
<Link
<SmartLink
href={post?.href}
passHref
className={
' group-hover:text-indigo-700 group-hover:dark:text-indigo-400 text-black dark:text-gray-100 dark:group-hover:text-yellow-600 line-clamp-2 replace cursor-pointer text-xl font-extrabold leading-tight'
}>
<span className='menu-link '>{post.title}</span>
</Link>
</SmartLink>
</div>
{/* 摘要 */}