Skip to content

Commit 60c23d4

Browse files
authored
fix: append a / to the search link. (#432)
Most hosting providers HTTP redirect `mysite.com/docs/search?q=test` to `mysite.com/docs/search/?q=test`... except S3 which tosses out the query string and redirects to `mysite.com/docs/search/`. Rather than relying on the backend redirect to work, tweak the link here on the frontend to already contain the slash suffixed path.
1 parent c359957 commit 60c23d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docusaurus-search-local/src/client/theme/SearchBar/SearchBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export default function SearchBar({
220220
}
221221
params.set("version", versionUrl.substring(baseUrl.length));
222222
}
223-
const url = `${baseUrl}search?${params.toString()}`;
223+
const url = `${baseUrl}search/?${params.toString()}`;
224224
a.href = url;
225225
a.textContent = linkText;
226226
a.addEventListener("click", (e) => {

0 commit comments

Comments
 (0)