diff --git a/hugo.yml b/hugo.yml index ba23d38c0260..1ff261b04228 100644 --- a/hugo.yml +++ b/hugo.yml @@ -73,6 +73,11 @@ params: analytics: fathom_site: "ITUSEYJG" + algolia: + appId: "AK7KMZKZHQ" + apiKey: "3151f502c7b9e9dafd5e6372b691a24e" + indexName: "bootstrap" + download: source: "https://github.com/twbs/bootstrap/archive/v5.3.3.zip" dist: "https://github.com/twbs/bootstrap/releases/download/v5.3.3/bootstrap-5.3.3-dist.zip" diff --git a/site/assets/js/search.js b/site/assets/js/search.js index 95d920c445fe..48047abc8750 100644 --- a/site/assets/js/search.js +++ b/site/assets/js/search.js @@ -10,6 +10,9 @@ */ import docsearch from '@docsearch/js' +// https://gohugo.io/hugo-pipes/js/#options +// eslint-disable-next-line import/no-unresolved +import { appId, apiKey, indexName } from '@params'; (() => { const searchElement = document.getElementById('docsearch') @@ -21,9 +24,9 @@ import docsearch from '@docsearch/js' const siteDocsVersion = searchElement.getAttribute('data-bd-docs-version') docsearch({ - apiKey: '3151f502c7b9e9dafd5e6372b691a24e', - indexName: 'bootstrap', - appId: 'AK7KMZKZHQ', + apiKey, + indexName, + appId, container: searchElement, searchParameters: { facetFilters: [`version:${siteDocsVersion}`] diff --git a/site/layouts/partials/header.html b/site/layouts/partials/header.html index 3f259ac5e842..66bdf2fb1bcf 100644 --- a/site/layouts/partials/header.html +++ b/site/layouts/partials/header.html @@ -10,7 +10,7 @@ {{ if (ne .Page.Layout "examples") -}} - + {{- end }}