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

@@ -6,7 +6,7 @@ import { useGlobal } from '@/lib/global'
import { isBrowser } from '@/lib/utils'
import { Transition } from '@headlessui/react'
import dynamic from 'next/dynamic'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useRouter } from 'next/router'
import { createContext, useContext, useEffect, useRef } from 'react'
import BlogPostBar from './components/BlogPostBar'
@@ -301,7 +301,7 @@ const LayoutCategoryIndex = props => {
<div id='category-list' className='duration-200 flex flex-wrap'>
{categoryOptions?.map(category => {
return (
<Link
<SmartLink
key={category.name}
href={`/category/${category.name}`}
passHref
@@ -313,7 +313,7 @@ const LayoutCategoryIndex = props => {
<i className='mr-4 fas fa-folder' />
{category.name}({category.count})
</div>
</Link>
</SmartLink>
)
})}
</div>
@@ -334,7 +334,7 @@ const LayoutTagIndex = props => {
{tagOptions.map(tag => {
return (
<div key={tag.name} className='p-2'>
<Link
<SmartLink
key={tag}
href={`/tag/${encodeURIComponent(tag.name)}`}
passHref
@@ -343,7 +343,7 @@ const LayoutTagIndex = props => {
<i className='mr-1 fas fa-tag' />{' '}
{tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
</div>
</Link>
</SmartLink>
</div>
)
})}