Skip to content

Commit cfb6ddd

Browse files
committed
Fixes #11189
- Users will now be able to create `div`s and `span`s that exclude certain page elements from the search index.
1 parent e928dd8 commit cfb6ddd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/project/types/website/website-search.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ export async function updateSearchIndex(
291291
}
292292
});
293293

294+
// Remove all page elements that should be excluded from the search index
295+
const exclusions = doc.querySelectorAll(".quarto-exclude-from-search-index");
296+
for (const exclusion of exclusions) {
297+
exclusion._remove();
298+
}
299+
294300
// We always take the first child of the main region (whether that is a p or section)
295301
// and create an index entry for the page itself (with no hash). If there is other
296302
// 'unsectioned' content on the page, we include that as well.

0 commit comments

Comments
 (0)