File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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 } ) ;
Original file line number Diff line number Diff line change 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 -->
You can’t perform that action at this time.
0 commit comments