From c57e12dd31227cbeb5f2131feecf4220832e8449 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Mon, 27 Nov 2023 22:19:43 +0100 Subject: [PATCH] feat(bootstrap): support facet filters for docsearch (#3026) Closes #3022 --- modules/blox-bootstrap/layouts/partials/site_js.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/blox-bootstrap/layouts/partials/site_js.html b/modules/blox-bootstrap/layouts/partials/site_js.html index 3a8881926..ab06c6627 100644 --- a/modules/blox-bootstrap/layouts/partials/site_js.html +++ b/modules/blox-bootstrap/layouts/partials/site_js.html @@ -91,6 +91,9 @@ {{ $algoliaConfig = dict "appId" (site.Params.features.search.algolia.app_id | default "") "apiKey" (site.Params.features.search.algolia.api_key | default "") "indexName" (site.Params.features.search.algolia.index_name | default "") "analytics" (site.Params.features.search.algolia.analytics | default false) "personalization" (site.Params.features.search.algolia.personalization | default false) }} {{ else if eq $search_provider "docsearch" }} {{ $docsearch_config := dict "appId" (site.Params.features.search.docsearch.app_id | default "") "apiKey" (site.Params.features.search.docsearch.api_key | default "") "indexName" (site.Params.features.search.docsearch.index_name | default "") "container" (site.Params.features.search.docsearch.container | default "#docsearch") }} + {{ if (site.Params.features.search.docsearch.search_parameters.facetFilters) }} + {{ $docsearch_config = merge $docsearch_config (dict (slice "searchParameters" "facetFilters") (site.Params.features.search.docsearch.search_parameters.facetFilters ))}} + {{ end }} {{ printf "" ($docsearch_config | jsonify) | safeHTML }} {{ end }}