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

@@ -4,7 +4,7 @@ import NotionIcon from '@/components/NotionIcon'
import WordCount from '@/components/WordCount'
import { siteConfig } from '@/lib/config'
import { formatDateFmt } from '@/lib/utils/formatDate'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import WavesArea from './WavesArea'
/**
@@ -60,7 +60,7 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) {
<div className='flex justify-center md:justify-start items-center gap-4'>
{post.category && (
<>
<Link
<SmartLink
href={`/category/${post.category}`}
className='mr-4'
passHref
@@ -68,14 +68,14 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) {
<div className='cursor-pointer font-sm font-bold px-3 py-1 rounded-lg hover:bg-white text-white bg-blue-500 dark:bg-yellow-500 hover:text-blue-500 duration-200 '>
{post.category}
</div>
</Link>
</SmartLink>
</>
)}
{post.tagItems && (
<div className='hidden md:flex justify-center flex-nowrap overflow-x-auto'>
{post.tagItems.map((tag, index) => (
<Link
<SmartLink
key={index}
href={`/tag/${encodeURIComponent(tag.name)}`}
passHref
@@ -86,7 +86,7 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) {
<HashTag className='text-gray-200 stroke-2 mr-0.5 w-3 h-3' />{' '}
{tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
</div>
</Link>
</SmartLink>
))}
</div>
)}
@@ -111,13 +111,13 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) {
</div>
{post?.type !== 'Page' && (
<>
<Link
<SmartLink
href={`/archive#${formatDateFmt(post?.publishDate, 'yyyy-MM')}`}
passHref
className='pl-1 mr-2 cursor-pointer hover:underline'>
<i className='fa-regular fa-calendar'></i>{' '}
{post?.publishDay}
</Link>
</SmartLink>
</>
)}