Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

gitbook-plugin-docsearch-temp

1.1.3 • Public • Published

GitBook Plugin to add Algolia docSearch Plugin

FORK VERSION.

Installation

npm install azu/gitbook-plugin-docsearch

Usage

Gitbook comes with default search option. In order to use this plugin, need to disable the default search plugins and add docSearch as bellow :

"plugins": [
    "-search",
    "-lunr",
    "docSearch"
  ]

add the following plugin configurations in book.json

{
   "pluginsConfig": {
     "docSearch": {
       "apiKey" : "replace_with_algolia_doc_search_api_key",
       "index" : "replace_with_algolia_doc_search_index",
        "logo" : "logo.png",
        "brandUrl" : "https://uilicious.com/"
     }
   }
}

logo and brandUrl is optional. So you can choose to leave them empty if you do want want to put your brand logo in Gitbook.

In order to customize the styling of your search experience you can supply a css separately as bellow inside book.json

"addcssjs": {
   "css": [
        "css/replace_with_your_file_name.css"
        ]
    }

Known issues

The default behaviour of algolia search result prompt crops out. See bellow :

In order to fix it, apply the following css with styling

.book-summary {
    overflow-y: inherit;
}

License & copyright

Licensed under the MIT License

Install

npm i gitbook-plugin-docsearch-temp

DownloadsWeekly Downloads

1

Version

1.1.3

License

none

Unpacked Size

194 kB

Total Files

7

Last publish

Collaborators

  • avatar