Skip to content

Commit

Permalink
Fixes #11189
Browse files Browse the repository at this point in the history
- Users will now be able to create `div`s and `span`s that exclude
certain page elements from the search index.
  • Loading branch information
nickvigilante committed Oct 24, 2024
1 parent e928dd8 commit 5e1d1f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/project/types/website/website-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ export async function updateSearchIndex(
}
});

// Remove all page elements that should be excluded from the search index
const exclusions = doc.querySelectorAll(".quarto-exclude-from-search-index");
for (const exclusion of exclusions) {
exclusion._remove();
}

// We always take the first child of the main region (whether that is a p or section)
// and create an index entry for the page itself (with no hash). If there is other
// 'unsectioned' content on the page, we include that as well.
Expand Down
1 change: 1 addition & 0 deletions tests/docs/bug-repros/issue-1340/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/

0 comments on commit 5e1d1f9

Please sign in to comment.