Work around compat break in old index.hbs templates with new searcher.js
Problem reported in https://github.com/rust-lang/mdBook/pull/2742#discussion_r2190930557
This commit is contained in:
parent
ec6f26e652
commit
7ec083e426
1 changed files with 4 additions and 1 deletions
|
|
@ -434,7 +434,10 @@ window.search = window.search || {};
|
||||||
|
|
||||||
function showSearch(yes) {
|
function showSearch(yes) {
|
||||||
if (yes) {
|
if (yes) {
|
||||||
loadSearchScript(window.path_to_searchindex_js, 'search-index');
|
loadSearchScript(
|
||||||
|
window.path_to_searchindex_js ||
|
||||||
|
path_to_root + '{{ resource "searchindex.js" }}',
|
||||||
|
'search-index');
|
||||||
search_wrap.classList.remove('hidden');
|
search_wrap.classList.remove('hidden');
|
||||||
searchicon.setAttribute('aria-expanded', 'true');
|
searchicon.setAttribute('aria-expanded', 'true');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue