Member-only story

Documentation

Enable docsearch in documentation page

The example will be illustrated with docusaurus.

Donald Le

--

Photo by Nick Linnen on Unsplash

Docsearch is a free service offered by Algolia. You can find more details about here. You can contact them and they will reply you with email about the apikey and index name of the database they crawl from your docs site.

In the siteconfig.js configuration of docusaurus, all you need to do is add:

algolia: {
apiKey: '{api_key}',
indexName: '{index_name}',
algoliaOptions: { 'facetFilters': ["language:LANGUAGE"] },
placeholder: 'Seek and you can see'
},

the facetFilters if set with language is LANGUAGE will allow users to search the content at the language they are viewing, or you can hardcode with the language of your choice.

And here we go, check out : https://genome.vinbigdata.org/documentation/en/intro.html as an example illustration.

PEACE~~

--

--

No responses yet