What is @docusaurus/theme-search-algolia?
@docusaurus/theme-search-algolia is a theme for Docusaurus that integrates Algolia DocSearch, providing a powerful and customizable search experience for your documentation site.
What are @docusaurus/theme-search-algolia's main functionalities?
Integration with Algolia DocSearch
This feature allows you to integrate Algolia DocSearch into your Docusaurus site by providing your Algolia API key, index name, and optionally, your Algolia App ID.
module.exports = {
themeConfig: {
algolia: {
apiKey: 'YOUR_API_KEY',
indexName: 'YOUR_INDEX_NAME',
appId: 'YOUR_APP_ID', // Optional, if you have an Algolia App ID
},
},
};
Customizable Search UI
This feature allows you to customize the search UI by enabling contextual search and adding additional search parameters.
module.exports = {
themeConfig: {
algolia: {
apiKey: 'YOUR_API_KEY',
indexName: 'YOUR_INDEX_NAME',
contextualSearch: true, // Optional, enables contextual search
searchParameters: {}, // Optional, additional search parameters
},
},
};
Styling and Theming
This feature allows you to style and theme the search component by including external stylesheets and configuring the search page path.
module.exports = {
stylesheets: [
'https://cdn.jsdelivr.net/npm/@algolia/autocomplete-theme-classic',
],
themeConfig: {
algolia: {
apiKey: 'YOUR_API_KEY',
indexName: 'YOUR_INDEX_NAME',
searchPagePath: 'search', // Optional, custom search page path
},
},
};
Other packages similar to @docusaurus/theme-search-algolia
react-instantsearch-dom
react-instantsearch-dom is a library for building search interfaces with Algolia in React applications. It provides a set of React components and connectors to build powerful search experiences. Compared to @docusaurus/theme-search-algolia, it offers more flexibility and customization options but requires more setup and configuration.
docsearch.js
docsearch.js is a JavaScript library that provides a ready-to-use search experience for documentation websites using Algolia DocSearch. It is less integrated with Docusaurus compared to @docusaurus/theme-search-algolia but can be used with any static site generator or custom website.
gatsby-plugin-algolia
gatsby-plugin-algolia is a Gatsby plugin that integrates Algolia search into Gatsby sites. It provides a way to index your Gatsby site's content and build a search interface using Algolia. It is similar to @docusaurus/theme-search-algolia but tailored for Gatsby sites.
2.0.0-alpha.38 (2019-12-06)
:boom: Breaking Change
docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-theme-classic
, docusaurus-utils
- #2088 perf(v2): smaller bundlesize by embedding metadata to content (@endiliey)
If you have swizzled any Docs/Blog component that depends on metadata, you'll have to update. If you haven't, no action is needed.
For example, if you've swizzled @theme/DocItem
. You'll have to update
- const {metadata, content: DocContent} = props;
+ const {content: DocContent} = props;
+ const {metadata} = DocContent;
:bug: Bug Fix
docusaurus
docusaurus-plugin-ideal-image
- #2074 fix(v2): fix plugin-ideal-image breaking website (exports not defined) (@endiliey)
:nail_care: Polish
:house: Internal
docusaurus-1.x
docusaurus
- #2081 refactor(v2): move scripts/stylesheets injection to server side (@endiliey)
- #2080 refactor(v2): minor code refactoring on component creator (@endiliey)
:running_woman: Performance
docusaurus-utils
- #2089 perf(v2): improve dev build time by not overwriting file if possible (@endiliey)
docusaurus-theme-search-algolia
- #2079 perf(v2): algolia search result no longer cause full page refresh (@endiliey)
- #2076 perf(v2): load algolia JS only when user interacts with search (@endiliey)
Committers: 4