Skip to content

Commit 360e906

Browse files
committed
f
1 parent c051403 commit 360e906

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

theme/ht_searcher.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@
121121
const CLOUD_REMOTE_SOURCES = cloudFilenames.map(function(filename) { return searchindexBase + '/' + filename; });
122122
123123
const indices = [];
124-
const main = await loadWithFallback(MAIN_REMOTE_SOURCES , '/searchindex-book.js', false); if(main) indices.push(main);
125-
const cloud= await loadWithFallback(CLOUD_REMOTE_SOURCES, '/searchindex.js', true ); if(cloud) indices.push(cloud);
124+
/* Local fallback on book origin exists as /searchindex.js (mdBook default output). */
125+
const main = await loadWithFallback(MAIN_REMOTE_SOURCES , '/searchindex.js', false); if(main) indices.push(main);
126+
/* Cloud local fallback does not exist on book origin; rely on remote cloud index only. */
127+
const cloud= await loadWithFallback(CLOUD_REMOTE_SOURCES, null, true); if(cloud) indices.push(cloud);
126128
if(!indices.length){ postMessage({ready:false, error:'no-index'}); return; }
127129
128130
/* build index objects */
@@ -271,4 +273,4 @@
271273
listOut.classList.toggle('hidden',!docs.length);
272274
};
273275
})();
274-
276+

0 commit comments

Comments
 (0)