Skip to content

Commit f829073

Browse files
committed
Updated searchindex url
1 parent ea3d782 commit f829073

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

theme/ht_searcher.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,13 @@ window.search = window.search || {};
471471
showResults(true);
472472
}
473473

474-
fetch(path_to_root + 'searchindex.json')
474+
var branch = lang === "en" ? "master" : lang
475+
fetch(`https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/refs/heads/${branch}/searchindex.json`)
475476
.then(response => response.json())
476477
.then(json => init(json))
477478
.catch(error => { // Try to load searchindex.js if fetch failed
478479
var script = document.createElement('script');
479-
script.src = path_to_root + 'searchindex.js';
480+
script.src = `https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/refs/heads/${branch}/searchindex.js`;
480481
script.onload = () => init(window.search);
481482
document.head.appendChild(script);
482483
});

theme/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<!-- Provide site root to javascript -->
5656
<script>
5757
var path_to_root = "{{ path_to_root }}";
58+
var lang = "{{ language }}";
5859
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
5960
</script>
6061
<!-- Start loading toc.js asap -->

0 commit comments

Comments
 (0)