Skip to content

Commit

Permalink
Rollup merge of #92742 - GuillaumeGomez:missing-suffix-sidebar-items,…
Browse files Browse the repository at this point in the history
… r=notriddle

Add missing suffix for sidebar-items script path

Fixes rust-lang/docs.rs#1590.

r? ```@syphar```
  • Loading branch information
matthiaskrgr authored Jan 12, 2022
2 parents eecdfe5 + 881b427 commit bc0a165
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
_ => unreachable!(),
};
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());
scx.fs.write(js_dst, v)?;
}
Expand Down
6 changes: 5 additions & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,11 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
ty = it.type_(),
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.
buffer.write_str("</div>");
}
Expand Down

0 comments on commit bc0a165

Please sign in to comment.