diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 987cec6fbfa96..b7af28fbcc8ae 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -177,7 +177,10 @@ pub fn render( root_path = page.root_path, css_class = page.css_class, logo = if layout.logo.is_empty() { - String::new() + format!("\ + logo", + static_root_path=static_root_path, + suffix=page.resource_suffix) } else { format!("\ logo", diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 31e06cb1a045f..d050b706f1031 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -789,6 +789,10 @@ fn write_shared( themes.insert(theme.to_owned()); } + if (*cx.shared).layout.logo.is_empty() { + write(cx.dst.join(&format!("rust-logo{}.png", cx.shared.resource_suffix)), + static_files::RUST_LOGO)?; + } write(cx.dst.join(&format!("brush{}.svg", cx.shared.resource_suffix)), static_files::BRUSH_SVG)?; write(cx.dst.join(&format!("wheel{}.svg", cx.shared.resource_suffix)), diff --git a/src/librustdoc/html/static/rust-logo.png b/src/librustdoc/html/static/rust-logo.png new file mode 100644 index 0000000000000..74b4bd695045e Binary files /dev/null and b/src/librustdoc/html/static/rust-logo.png differ diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index f340590e5fe33..bd048d2ec9742 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -51,6 +51,9 @@ pub static LICENSE_APACHE: &'static [u8] = include_bytes!("static/LICENSE-APACHE /// The contents of `LICENSE-MIT.txt`, the text of the MIT License. pub static LICENSE_MIT: &'static [u8] = include_bytes!("static/LICENSE-MIT.txt"); +/// The contents of `rust-logo.png`, the default icon of the documentation. +pub static RUST_LOGO: &'static [u8] = include_bytes!("static/rust-logo.png"); + /// The built-in themes given to every documentation site. pub mod themes { /// The "light" theme, selected by default when no setting is available. Used as the basis for