-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass version aliases to DocSearch (#181)
- Loading branch information
1 parent
ecda120
commit fd8b640
Showing
1 changed file
with
5 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,6 @@ | |
|
||
{{!-- DocSearch only available if the search bar is displayed --}} | ||
{{#if (isSearchBarDisplayed site page)}} | ||
<script> | ||
// var ALGOLIA_INSIGHTS_SRC = "https://cdn.jsdelivr.net/npm/[email protected]"; | ||
// | ||
// !function (e, a, t, n, s, i, c) { | ||
// e.AlgoliaAnalyticsObject = s, e[s] = e[s] || function () { | ||
// (e[s].queue = e[s].queue || []).push(arguments) | ||
// }, i = a.createElement(t), c = a.getElementsByTagName(t)[0], | ||
// i.async = 1, i.src = n, c.parentNode.insertBefore(i, c) | ||
// }(window, document, "script", ALGOLIA_INSIGHTS_SRC, "aa"); | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
docsearch({ | ||
container: '#docsearch', | ||
|
@@ -25,30 +14,13 @@ | |
indexName: 'bonitasoft', | ||
hitsPerPage: 20, | ||
searchParameters: { | ||
facetFilters: ["version:{{page.version}}", "tags:{{page.component.name}}"], | ||
{{#if page.attributes.version-alias}} | ||
facetFilters: [["version:{{page.version}}", "version:{{page.attributes.version-alias}}"], "tags:{{page.component.name}}"], | ||
{{else}} | ||
facetFilters: [["version:{{page.version}}"], "tags:{{page.component.name}}"], | ||
{{/if}} | ||
} | ||
}); | ||
/* | ||
docsearch({ | ||
algoliaOptions: { | ||
clickAnalytics: true, | ||
}, | ||
handleSelected: function (input, event, suggestion, datasetNumber, context) { | ||
sendClickEvent(lastQueryID, lastQueryHits, suggestion); | ||
input.setVal(''); | ||
window.location.assign(suggestion.url); | ||
}, | ||
queryDataCallback: function (data) { | ||
lastQueryID = data.results[0].queryID; | ||
lastQueryHits = data.results[0].hits; | ||
} | ||
}); | ||
aa('init', { | ||
appId: 'BH4D9OD16A', | ||
apiKey: '16267f96d135c47df8454efd5b448c9a', | ||
}); | ||
*/ | ||
</script> | ||
{{/if}} | ||
|
||
|