diff --git a/src/_includes/layouts/common-js.njk b/src/_includes/layouts/common-js.njk index e565b3e937..711f000a64 100644 --- a/src/_includes/layouts/common-js.njk +++ b/src/_includes/layouts/common-js.njk @@ -25,6 +25,20 @@ const searchScope = document.head.querySelector('[property="article:section"][content]')?.content ?? ''; function initSearchBar() { + const {autocomplete, getAlgoliaResults} = window['@algolia/autocomplete-js']; + const searchClient = algoliasearch('KWE0727TZS', '595ee07f069991380e9c3036cfad8e5e'); + const scopeTitles = { + 'ama': 'Ask Me Anything', + 'blog': 'Blog', + 'changelog': 'Changelog', + 'customer-stories': 'Customer Stories', + 'docs': 'Docs', + 'ebooks': 'E-Books', + 'handbook': 'Handbook', + 'node-red': 'Node-RED', + 'webinars': 'Webinars', + } + const placeholder = Object.prototype.hasOwnProperty.call(scopeTitles, searchScope) ? `Search in ${scopeTitles[searchScope]}...` : 'Search...' }