feat(start主题 链接设置默认值与多语言化): 可能的站内链接部分使用Link,而非a,使其能正确多语言跳转

This commit is contained in:
anime
2024-12-20 22:05:57 +08:00
parent 1c4cb7b0e4
commit fe4b421b4e
7 changed files with 60 additions and 54 deletions

View File

@@ -2,6 +2,7 @@
import LazyImage from '@/components/LazyImage'
import { siteConfig } from '@/lib/config'
import CONFIG from '../config'
import Link from 'next/link'
/**
* 英雄大图区块
@@ -32,16 +33,16 @@ export const Hero = props => {
<ul className='mb-10 flex flex-wrap items-center justify-center gap-5'>
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config) && (
<li>
<a
href={siteConfig('STARTER_HERO_BUTTON_1_URL')}
<Link
href={siteConfig('STARTER_HERO_BUTTON_1_URL', '')}
className='inline-flex items-center justify-center rounded-md bg-white px-7 py-[14px] text-center text-base font-medium text-dark shadow-1 transition duration-300 ease-in-out hover:bg-gray-2 hover:text-body-color'>
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config)}
</a>
</Link>
</li>
)}
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config) && (
<li>
<a
<Link
href={siteConfig(
'STARTER_HERO_BUTTON_2_URL',
null,
@@ -65,7 +66,7 @@ export const Hero = props => {
/>
)}
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config)}
</a>
</Link>
</li>
)}
</ul>