Skip to content

Commit

Permalink
feat(bootstrap): support facet filters for docsearch (#3026)
Browse files Browse the repository at this point in the history
Closes #3022
  • Loading branch information
beckerjohannes authored Nov 27, 2023
1 parent 0263ff0 commit c57e12d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/blox-bootstrap/layouts/partials/site_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
{{ printf "<script>docsearch(%s);</script>" ($docsearch_config | jsonify) | safeHTML }}
{{ end }}
Expand Down

0 comments on commit c57e12d

Please # to comment.