mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 10:03:31 +00:00
Fix loading of search index in sub directories
This commit is contained in:
@@ -11,7 +11,7 @@ define([
|
||||
|
||||
// Load complete index
|
||||
var loadIndex = function() {
|
||||
return $.getJSON("search_index.json")
|
||||
return $.getJSON(state.basePath+"/search_index.json")
|
||||
.then(function(data) {
|
||||
index = lunr.Index.load(data);
|
||||
});
|
||||
|
||||
@@ -38,7 +38,6 @@ define([
|
||||
|
||||
// Filter summary with a list of path
|
||||
var filterSummary = function(paths) {
|
||||
console.log("filter with", paths);
|
||||
$summary.find("li").each(function() {
|
||||
var path = $(this).data("path");
|
||||
var st = paths == null || _.contains(paths, path);
|
||||
|
||||
@@ -7,6 +7,7 @@ define([
|
||||
'$book': $book,
|
||||
|
||||
'githubId': $book.data("github"),
|
||||
'level': $book.data("level")
|
||||
'level': $book.data("level"),
|
||||
'basePath': $book.data("basepath")
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user