Skip to content

Commit

Permalink
feat: pass version aliases to DocSearch (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecambon authored May 5, 2023
1 parent ecda120 commit fd8b640
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions src/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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}}

Expand Down

0 comments on commit fd8b640

Please sign in to comment.