Skip to content

Commit 4f0a672

Browse files
authored
Merge pull request #2056 from rocketstack-matt/feat/docs-search
feat(docs): add algolia docsearch configuration
2 parents 1c8fcac + d6ce6ce commit 4f0a672

3 files changed

Lines changed: 44 additions & 3 deletions

File tree

docs/DEVELOPER_GUIDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ The [OWASP dependency check tool](https://jeremylong.github.io/DependencyCheck/)
2424

2525
To use the dependency check tool locally, first install the tool following the instructions for your operating system [here](https://jeremylong.github.io/DependencyCheck/dependency-check-cli/index.html).
2626

27-
Once that is done the tool is configured as a script in the package.json, run `npm run dependency-check`; the reports will be output to `cli/dependency-check-report`.
27+
Once that is done the tool is configured as a script in the package.json, run `npm run dependency-check`; the reports will be output to `cli/dependency-check-report`.
28+
29+
## Search Configuration
30+
31+
The documentation uses [Algolia DocSearch](https://docsearch.algolia.com/) for full-text search.
32+
33+
To configure search locally or for production:
34+
1. Apply for DocSearch at https://docsearch.algolia.com/apply
35+
2. Once approved, Algolia will provide an `appId` and `apiKey`
36+
3. Update `docusaurus.config.js` with these credentials
37+
4. The crawler configuration is managed by Algolia, but runs weekly to index the content

docs/docusaurus.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,36 @@ const config = {
143143
theme: prismThemes.github,
144144
darkTheme: prismThemes.dracula,
145145
},
146+
algolia: {
147+
// The application ID provided by Algolia
148+
appId: '87IS6TKJAE',
149+
150+
// Public API key: it is safe to commit it
151+
apiKey: 'dfdc380d6e179c38f558cb610645257a',
152+
153+
indexName: 'calm-finos',
154+
155+
// Optional: see doc section below
156+
contextualSearch: true,
157+
158+
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites
159+
// externalUrlRegex: 'external\\.com|domain\\.com',
160+
161+
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
162+
// replaceSearchResultPathname: {
163+
// from: '/docs/', // or as RegExp: /\/docs\//
164+
// to: '/',
165+
// },
166+
167+
// Optional: Algolia search parameters
168+
searchParameters: {},
169+
170+
// Optional: path for search page that enabled by default (`false` to disable it)
171+
searchPagePath: 'search',
172+
173+
// Optional: whether the insights feature is enabled or not on Docsearch (`false` by default)
174+
// insights: false,
175+
},
146176
}),
147177
};
148178

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)