diff --git a/docs/next.config.mjs b/docs/next.config.mjs index 07bd088..bf33f76 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -15,6 +15,9 @@ const config = { images: { unoptimized: true, }, + env: { + NEXT_PUBLIC_DOCS_BASE_PATH: basePath, + }, }; export default withMDX(config); diff --git a/docs/src/components/search.tsx b/docs/src/components/search.tsx index c46e11e..3b2dc8a 100644 --- a/docs/src/components/search.tsx +++ b/docs/src/components/search.tsx @@ -22,12 +22,15 @@ function initOrama() { }); } +const basePath = process.env.NEXT_PUBLIC_DOCS_BASE_PATH ?? ""; + export default function DefaultSearchDialog(props: SharedProps) { const { locale } = useI18n(); // (optional) for i18n const { search, setSearch, query } = useDocsSearch({ type: "static", initOrama, locale, + from: `${basePath}/api/search`, }); return (