From 881b427fa3cd53097d05b68079f435949d94e51f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 10 Jan 2022 21:01:09 +0100 Subject: [PATCH] Add missing suffix for sidebar-items script path --- src/librustdoc/html/render/context.rs | 2 +- src/librustdoc/html/render/mod.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 534a542d58ed0..0e661228bedfa 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -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)?; } diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 7adf63f26f602..76840d9fe7c5b 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1823,7 +1823,11 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) { ty = it.type_(), path = relpath ); - write!(buffer, "", relpath); + write!( + buffer, + "", + relpath, cx.shared.resource_suffix + ); // Closes sidebar-elems div. buffer.write_str(""); }