File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,19 @@ function initOrama() {
2424
2525export default function DefaultSearchDialog ( props : SharedProps ) {
2626 const { locale } = useI18n ( ) // (optional) for i18n
27+ // Determine API base path at build/runtime. When deployed to GitHub Pages
28+ // the site lives under a subpath (e.g. /evolution-sdk). Set
29+ // NEXT_PUBLIC_BASE_PATH=/evolution-sdk in CI so the client requests the
30+ // correct static search JSON. Falls back to empty string for local dev.
31+ const basePath = process . env . NEXT_PUBLIC_BASE_PATH ?? ''
32+ const normalizedBase = basePath . endsWith ( '/' ) && basePath . length > 1 ? basePath . slice ( 0 , - 1 ) : basePath
33+ const apiFrom = `${ normalizedBase } /api/search`
34+
2735 const { search, setSearch, query } = useDocsSearch ( {
2836 type : "static" ,
2937 initOrama,
30- locale
38+ locale,
39+ from : apiFrom ,
3140 } )
3241
3342 return (
Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
3- /// <reference path="./out /types/routes.d.ts" />
3+ /// <reference path="./.next /types/routes.d.ts" />
44
55// NOTE: This file should not be edited
66// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
You can’t perform that action at this time.
0 commit comments