Skip to content

Commit f4f5755

Browse files
authored
Rollup merge of rust-lang#92742 - GuillaumeGomez:missing-suffix-sidebar-items, r=notriddle
Add missing suffix for sidebar-items script path Fixes rust-lang/docs.rs#1590. r? `@syphar`
2 parents 717bde7 + 881b427 commit f4f5755

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustdoc/html/render/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
665665
_ => unreachable!(),
666666
};
667667
let items = self.build_sidebar_items(module);
668-
let js_dst = self.dst.join("sidebar-items.js");
668+
let js_dst = self.dst.join(&format!("sidebar-items{}.js", self.shared.resource_suffix));
669669
let v = format!("initSidebarItems({});", serde_json::to_string(&items).unwrap());
670670
scx.fs.write(js_dst, v)?;
671671
}

src/librustdoc/html/render/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,11 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
18271827
ty = it.type_(),
18281828
path = relpath
18291829
);
1830-
write!(buffer, "<script defer src=\"{}sidebar-items.js\"></script>", relpath);
1830+
write!(
1831+
buffer,
1832+
"<script defer src=\"{}sidebar-items{}.js\"></script>",
1833+
relpath, cx.shared.resource_suffix
1834+
);
18311835
// Closes sidebar-elems div.
18321836
buffer.write_str("</div>");
18331837
}

0 commit comments

Comments
 (0)