Move search JS into search-index.js
Export a few variables and functions into the global scope because they are needed both by main.js and search-index.js.
This commit is contained in:
parent
d4d7ebf142
commit
276ee6f542
4 changed files with 1534 additions and 1524 deletions
|
@ -408,9 +408,8 @@ pub(super) fn write_shared(
|
|||
// with rustdoc running in parallel.
|
||||
all_indexes.sort();
|
||||
write_crate("search-index.js", &|| {
|
||||
let mut v = String::from("var searchIndex = JSON.parse('{\\\n");
|
||||
v.push_str(&all_indexes.join(",\\\n"));
|
||||
v.push_str("\\\n}');\ninitSearch(searchIndex);");
|
||||
let v = static_files::SEARCH_JS
|
||||
.replace(r#""SEARCH_INDEX_PLACEHOLDER": {}"#, &all_indexes.join(",\\\n"));
|
||||
Ok(v.into_bytes())
|
||||
})?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue