description = page.description,
keywords = page.keywords,
favicon = if layout.favicon.is_empty() {
- String::new()
+ format!(r#"<link rel="shortcut icon" href="{static_root_path}favicon{suffix}.ico">"#,
+ static_root_path=static_root_path,
+ suffix=page.resource_suffix)
} else {
format!(r#"<link rel="shortcut icon" href="{}">"#, layout.favicon)
},
write(cx.dst.join(&format!("rust-logo{}.png", cx.shared.resource_suffix)),
static_files::RUST_LOGO)?;
}
+ if (*cx.shared).layout.favicon.is_empty() {
+ write(cx.dst.join(&format!("favicon{}.ico", cx.shared.resource_suffix)),
+ static_files::RUST_FAVICON)?;
+ }
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)),
themes.push(PathBuf::from("settings.css"));
let mut layout = self.shared.layout.clone();
layout.krate = String::new();
- layout.logo = String::new();
- layout.favicon = String::new();
try_err!(layout::render(&mut w, &layout,
&page, &sidebar, &settings,
self.shared.css_file_extension.is_some(),
/// 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 contents of `favicon.ico`, the default favicon of the documentation.
+pub static RUST_FAVICON: &'static [u8] = include_bytes!("static/favicon.ico");
/// The built-in themes given to every documentation site.
pub mod themes {