Merge pull request #2742 from notriddle/cache-fix-searchindex

Remove direct search index reference from searcher
This commit is contained in:
Guillaume Gomez 2025-07-07 19:25:09 +00:00 committed by GitHub
commit 4bf2b472bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -434,7 +434,7 @@ window.search = window.search || {};
function showSearch(yes) {
if (yes) {
loadSearchScript(path_to_root + '{{ resource "searchindex.js" }}', 'search-index');
loadSearchScript(window.path_to_searchindex_js, 'search-index');
search_wrap.classList.remove('hidden');
searchicon.setAttribute('aria-expanded', 'true');
} else {

View file

@ -58,6 +58,9 @@
const path_to_root = "{{ path_to_root }}";
const default_light_theme = "{{ default_theme }}";
const default_dark_theme = "{{ preferred_dark_theme }}";
{{#if search_js}}
window.path_to_searchindex_js = "{{ resource "searchindex.js" }}";
{{/if}}
</script>
<!-- Start loading toc.js asap -->
<script src="{{ resource "toc.js" }}"></script>