Skip to content

Commit 5d51034

Browse files
committed
enable search
1 parent d4eb0da commit 5d51034

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

algolia.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"index_name": "freeswitch-docs",
3+
"start_urls": [{ "url": "https://developer.signalwire.com/freeswitch" }],
4+
"stop_urls": ["https://developer.signalwire.com/freeswitch/Channel-Variables-Catalog/.*"],
5+
"sitemap_urls": ["https://developer.signalwire.com/freeswitch/sitemap.xml"],
6+
"sitemap_alternate_links": true,
7+
"selectors": {
8+
"default": {
9+
"lvl0": {
10+
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]",
11+
"type": "xpath",
12+
"global": true,
13+
"default_value": "Documentation"
14+
},
15+
"lvl1": "article h1",
16+
"lvl2": "article h2"
17+
}
18+
},
19+
"strip_chars": " .,;:#",
20+
"custom_settings": {
21+
"separatorsToIndex": "_",
22+
"attributesForFaceting": ["language", "version", "type", "docusaurus_tag"],
23+
"attributesToRetrieve": [
24+
"hierarchy",
25+
"content",
26+
"anchor",
27+
"url",
28+
"url_without_anchor",
29+
"type"
30+
]
31+
},
32+
"conversation_id": ["833762294"]
33+
}

docusaurus.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ const config = {
126126
theme: lightCodeTheme,
127127
darkTheme: darkCodeTheme,
128128
},
129+
algolia: {
130+
appId: "2NBPM6ETKJ",
131+
apiKey: "4489aa468117b5bfbcb83f7b0addddc9",
132+
indexName: "freeswitch-docs",
133+
externalUrlRegex: `.*`,
134+
/**
135+
* We need to set this to false, otherwise the query is done with
136+
* default filters such as "docusaurus_tag:docs-default-current", which
137+
* exclude all the content from README.
138+
*
139+
* Look for default facetFilters.
140+
*/
141+
contextualSearch: false,
142+
/**
143+
* We need to disable the searchPage because the results there are not
144+
* accurate (they don't respect the contextualSearch setting value).
145+
*
146+
* Reference: https://github.com/facebook/docusaurus/issues/3805
147+
*/
148+
searchPagePath: false,
149+
},
129150
}),
130151

131152
plugins: ["docusaurus-plugin-sass"],

0 commit comments

Comments
 (0)