Rollup merge of #92742 - GuillaumeGomez:missing-suffix-sidebar-items, r=notriddle
Add missing suffix for sidebar-items script path Fixes https://github.com/rust-lang/docs.rs/issues/1590. r? ```@syphar```
This commit is contained in:
commit
bc0a165240
2 changed files with 6 additions and 2 deletions
|
@ -665,7 +665,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
let items = self.build_sidebar_items(module);
|
let items = self.build_sidebar_items(module);
|
||||||
let js_dst = self.dst.join("sidebar-items.js");
|
let js_dst = self.dst.join(&format!("sidebar-items{}.js", self.shared.resource_suffix));
|
||||||
let v = format!("initSidebarItems({});", serde_json::to_string(&items).unwrap());
|
let v = format!("initSidebarItems({});", serde_json::to_string(&items).unwrap());
|
||||||
scx.fs.write(js_dst, v)?;
|
scx.fs.write(js_dst, v)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1827,7 +1827,11 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
|
||||||
ty = it.type_(),
|
ty = it.type_(),
|
||||||
path = relpath
|
path = relpath
|
||||||
);
|
);
|
||||||
write!(buffer, "<script defer src=\"{}sidebar-items.js\"></script>", relpath);
|
write!(
|
||||||
|
buffer,
|
||||||
|
"<script defer src=\"{}sidebar-items{}.js\"></script>",
|
||||||
|
relpath, cx.shared.resource_suffix
|
||||||
|
);
|
||||||
// Closes sidebar-elems div.
|
// Closes sidebar-elems div.
|
||||||
buffer.write_str("</div>");
|
buffer.write_str("</div>");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue