dataroaring opened a new pull request, #3955: URL: https://github.com/apache/doris-website/pull/3955
## What Enable Apache Doris docs to opt into **Algolia DocSearch** without removing the existing local search (`@yang1666204/docusaurus-search-local`). ## Why The Algolia Crawler needs a domain-verification token served from `robots.txt`, and we want to A/B Algolia against the current local search before fully cutting over rather than swapping it out in one step. ## Changes | File | Change | |------|--------| | `static/robots.txt` | Add Algolia Crawler domain-verification token | | `docusaurus.config.js` | `USE_ALGOLIA` build flag; conditionally load the Algolia theme + `themeConfig.algolia` (read from env); expose `customFields.useAlgolia` | | `src/theme/SearchBar/index.js` | Swizzle renders Algolia's bar or the local bar at runtime based on `customFields.useAlgolia` | | `package.json` | Pin `@docusaurus/[email protected]` as a direct dependency | ## Design notes - **Additive, not a replacement.** The local-search theme stays loaded in both modes so its `@generated` index module (which the `proxiedGenerated` swizzle depends on) keeps compiling. - **Modal-only** DocSearch (`searchPagePath: false`) so it doesn't collide with the local `/search` route. `contextualSearch: true` keeps results scoped per version/locale. - **Default behavior is unchanged**: with `USE_ALGOLIA` unset, the site builds and serves the existing local search exactly as before. ## How to enable ```bash USE_ALGOLIA=true \ ALGOLIA_APP_ID=xxxx \ ALGOLIA_SEARCH_API_KEY=xxxx \ # search-only public key ALGOLIA_INDEX_NAME=doris \ yarn build ``` ## Testing - Default (local-search) path: config passes `node --check`; logically untouched. - ⚠️ The `USE_ALGOLIA=true` path has **not** been built end-to-end here (requires live Algolia credentials). Import path/default export for the Algolia SearchBar were verified, but a real `USE_ALGOLIA=true` build should be run before relying on it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
