Skip to content

Commit a58982f

Browse files
committed
forzar al search a buscar en el root
1 parent 404dcf5 commit a58982f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

themes/pyar/assets/js/flexsearch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
document.addEventListener('DOMContentLoaded', function() {
1+
document.addEventListener('DOMContentLoaded', function() {
22
var searchIndex = new FlexSearch.Index(); // Initialize FlexSearch
33
var index = {}; // This will store the index data globally within this script block
44

55
// Fetch the generated JSON file
6-
fetch('/wiki/search_index.json')
6+
var indexPath = document.location.origin + "/search_index.json"
7+
fetch(indexPath)
78
.then(response => response.json())
89
.then(data => {
910
index = data; // Store the fetched data in the 'index' variable
@@ -52,6 +53,7 @@ document.addEventListener('DOMContentLoaded', function() {
5253
});
5354
});
5455

56+
5557
// Function to close the search overlay
5658
function closeSearch() {
5759
document.getElementById('search_overlay').style.display = 'none';

0 commit comments

Comments
 (0)