mirror of
https://github.com/rust-lang/mdBook
synced 2025-03-04 23:27:17 +00:00
Don't strip relative path of additional javascript files
Previously, additional JavaScript files inside a directory were correctly copied (with their parent created), but the link to it was stripped of that parent. There's no need for that (and it was not done for CSS)
This commit is contained in:
parent
0c926b3e88
commit
f654c42426
1 changed files with 1 additions and 7 deletions
|
@ -422,13 +422,7 @@ fn make_data(
|
|||
for script in &html.additional_js {
|
||||
match script.strip_prefix(root) {
|
||||
Ok(p) => js.push(p.to_str().expect("Could not convert to str")),
|
||||
Err(_) => js.push(
|
||||
script
|
||||
.file_name()
|
||||
.expect("File has a file name")
|
||||
.to_str()
|
||||
.expect("Could not convert to str"),
|
||||
),
|
||||
Err(_) => js.push(script.to_str().expect("Could not convert to str")),
|
||||
}
|
||||
}
|
||||
data.insert("additional_js".to_owned(), json!(js));
|
||||
|
|
Loading…
Add table
Reference in a new issue