update: as-nned URL prefix for i18n routing

This commit is contained in:
alikia2x (寒寒) 2025-05-31 21:56:15 +08:00
parent 44bc99dd9d
commit d0d9c21aba
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
3 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ import { SearchIcon } from "@/components/icons/SearchIcon";
import { InfoIcon } from "@/components/icons/InfoIcon";
import { HomeIcon } from "@/components/icons/HomeIcon";
import { TextButton } from "@/components/ui/Buttons/TextButton";
import Link from "next/link";
import { Link } from "@/i18n/navigation";
export const HeaderDestop = () => {
return (
@ -101,14 +101,14 @@ export const HeaderMobile = () => {
)}
{!showsearchBox && (
<div className="absolute left-1/2 -translate-x-1/2 -translate-y-0.5 inline-flex h-full items-center">
<a href="/">
<Link href="/">
<DarkModeImage
lightSrc={LogoMobileLight}
darkSrc={LogoMobileDark}
alt="Logo"
className="w-24 h-8 translate-y-[2px]"
/>
</a>
</Link>
</div>
)}
{showsearchBox && <SearchBox close={() => setShowsearchBox(false)} />}

View File

@ -5,5 +5,7 @@ export const routing = defineRouting({
locales: ["en", "zh"],
// Used when no locale matches
defaultLocale: "zh"
defaultLocale: "zh",
localePrefix: "as-needed"
});