Skip to content

Commit

Permalink
only run modification on client side
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfrenken committed Feb 28, 2025
1 parent 7129f73 commit 56bb6cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ function useSearchParameters({ contextualSearch, ...props }) {

const contextualSearchFacetFilters = useAlgoliaContextualFacetFilters();

const tag = document.querySelector('meta[name="docusaurus_tag"]')?.content;
if (tag && tag.startsWith('docs-docs-j')) {
contextualSearchFacetFilters[1] = [`docusaurus_tag:${tag}`];
if (typeof document !== 'undefined') {
const tag = document.querySelector('meta[name="docusaurus_tag"]')?.content;
if (tag && tag.startsWith('docs-docs-j')) {
contextualSearchFacetFilters[1] = [`docusaurus_tag:${tag}`];
}
}

const configFacetFilters = props.searchParameters?.facetFilters ?? [];
Expand Down

0 comments on commit 56bb6cb

Please sign in to comment.