Update the Algolia search information (#49)

* Update the Algolia search information

- It is a guide
- Rename the file, specifying that it is a guide
- Add a commented out Aloglia section to siteConfig.js

* Different search bar location flag
This commit is contained in:
Joel Marcey 2017-08-08 11:47:18 -07:00 committed by GitHub
parent a56812cda3
commit bba7edd80f
3 changed files with 55 additions and 21 deletions

47
docs/guides-search.md Normal file
View file

@ -0,0 +1,47 @@
---
id: search
title: Enabling Search
---
Docusaurus supports search using [Algolia DocSearch](https://community.algolia.com/docsearch/). Once you have set up your site, [enter your site information](https://community.algolia.com/docsearch/) to have Algolia crawl your website's documentation pages. Algolia will then send you an API key and index name for your site.
### Enabling the Search Bar
Enter your search-only API key and index name into `siteConfig.js` in the `algolia` section to enable search for your site.
```js
const siteConfig = {
...
algolia: {
apiKey: "my-search-only-api-key-1234",
indexName: "my-index-name"
},
...
}
```
### Controlling the Location of the Search Bar
By default, the search bar will be the rightmost element in the top navigation bar.
If you want to change the default location, add the `searchBar` flag in the `headerLinks` field of `siteConfig.js` in your desired location. For example, you may want the search bar in between your internal and external links.
```js
const siteConfig = {
...
headerLinks: [
{...}
{...}
{ search: true }
{...}
{...}
],
...
}
```
### Disabling the Search Bar
To disable the search bar, comment out (recommended) or delete the `algolia` section in the `siteConfig.js` file.
Also, if you have customized the location of the search bar in `headerLinks`, set `search: false`.

View file

@ -1,21 +0,0 @@
---
id: search
title: Enabling Search
---
## Algolia Search Integration
Docusaurus supports search using [Algolia DocSearch](https://community.algolia.com/docsearch/). Once you have set up your site, you can use the link above to have Algolia crawl your website's documentation pages. Algolia will then send you an API key and index name for your site.
Enter your search-only API key and index name into `siteConfig.js` in the `algolia` section to enable search for your site. The search bar will be in the header navigation bar in between internal links and external links. To disable the search bar, delete the `algolia` section in the `siteConfig.js` file.
```js
const siteConfig = {
...
algolia: {
apiKey: "my-search-only-api-key-1234",
indexName: "my-index-name"
},
...
}
```

View file

@ -44,6 +44,14 @@ const siteConfig = {
headerIcon: "img/docusaurus.svg",
footerIcon: "img/docusaurus.svg",
favicon: "img/favicon.png",
// See https://docusaurus.io/docs/search for more information about Aloglia
// search
/*
algolia: {
apiKey: "my-search-only-api-key-1234",
indexName: "my-index-name"
},
*/
colors: {
primaryColor: "#2E8555",
secondaryColor: "#205C3B",