Skip to content

Commit 13be348

Browse files
committed
Fix locale prefixing for search results
1 parent 928544d commit 13be348

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/SearchForm/index.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
---
2-
import { getCurrentLocale } from "@i18n/utils";
2+
import { getCurrentLocale } from "@/src/i18n/utils";
33
44
const currentLocale = getCurrentLocale(Astro.url.pathname);
55
---
66

7-
<form action={`/${currentLocale}/search`} method="GET" role="search">
7+
<form
8+
action={`${currentLocale === "en" ? "" : `/${currentLocale}`}/search`}
9+
method="GET"
10+
role="search"
11+
>
812
<label for="search-term">Search</label>
913
<input
1014
id="search-term"

0 commit comments

Comments
 (0)