diff --git a/theme/ht_searcher.js b/theme/ht_searcher.js index 1cee01a8c..52e150d9a 100644 --- a/theme/ht_searcher.js +++ b/theme/ht_searcher.js @@ -471,12 +471,13 @@ window.search = window.search || {}; showResults(true); } - fetch(path_to_root + 'searchindex.json') + var branch = lang === "en" ? "master" : lang + fetch(`https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/refs/heads/${branch}/searchindex.json`) .then(response => response.json()) .then(json => init(json)) .catch(error => { // Try to load searchindex.js if fetch failed var script = document.createElement('script'); - script.src = path_to_root + 'searchindex.js'; + script.src = `https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/refs/heads/${branch}/searchindex.js`; script.onload = () => init(window.search); document.head.appendChild(script); }); diff --git a/theme/index.hbs b/theme/index.hbs index 166e177c4..70b70a68a 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -55,6 +55,7 @@