Skip to content

Commit dae3ef2

Browse files
authored
Rollup merge of #92854 - Urgau:better-rust-logo, r=GuillaumeGomez
Use the updated Rust logo in rustdoc This pull-request use the updated Rust logo from rust-lang/rust-artwork#9 and also change the logo format from PNG to SVG. | Before | After | | --- | --- | | ![Screenshot 2022-01-13 at 14-33-40 std - Rust](https://user-images.githubusercontent.com/3616612/149342697-7afe4c3e-2be5-444b-86f3-118712b4f7ae.png) | ![Screenshot 2022-01-13 at 14-33-15 std - Rust](https://user-images.githubusercontent.com/3616612/149342705-54ed27c6-0806-4c2d-baa1-4d65ed897e2b.png) | I also took the liberty to update the two PNG favicons with the SVG reducing their size by ~35% each. Fixes #92831 r? ```@jsha```
2 parents ccfee3d + b8ef148 commit dae3ef2

File tree

7 files changed

+67
-5
lines changed

7 files changed

+67
-5
lines changed

src/librustdoc/html/render/write_shared.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub(super) fn write_shared(
240240
}
241241

242242
if (*cx.shared).layout.logo.is_empty() {
243-
write_toolchain("rust-logo.png", static_files::RUST_LOGO)?;
243+
write_toolchain("rust-logo.svg", static_files::RUST_LOGO_SVG)?;
244244
}
245245
if (*cx.shared).layout.favicon.is_empty() {
246246
write_toolchain("favicon.svg", static_files::RUST_FAVICON_SVG)?;
Loading
Loading
-5.62 KB
Binary file not shown.
Loading

src/librustdoc/html/static_files.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ crate static LICENSE_APACHE: &[u8] = include_bytes!("static/LICENSE-APACHE.txt")
6767
/// The contents of `LICENSE-MIT.txt`, the text of the MIT License.
6868
crate static LICENSE_MIT: &[u8] = include_bytes!("static/LICENSE-MIT.txt");
6969

70-
/// The contents of `rust-logo.png`, the default icon of the documentation.
71-
crate static RUST_LOGO: &[u8] = include_bytes!("static/images/rust-logo.png");
70+
/// The contents of `rust-logo.svg`, the default icon of the documentation.
71+
crate static RUST_LOGO_SVG: &[u8] = include_bytes!("static/images/rust-logo.svg");
72+
7273
/// The default documentation favicons (SVG and PNG fallbacks)
7374
crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg");
7475
crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png");

src/librustdoc/templates/page.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
{%- if !layout.logo.is_empty() %}
8080
<img src="{{layout.logo}}" alt="logo"> {#- -#}
8181
{%- else -%}
82-
<img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.png" alt="logo"> {#- -#}
82+
<img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.svg" alt="logo"> {#- -#}
8383
{%- endif -%}
8484
</div>
8585
</a> {#- -#}
@@ -92,7 +92,7 @@
9292
{%- if !layout.logo.is_empty() %}
9393
<img src="{{layout.logo}}" alt="logo"> {#- -#}
9494
{%- else -%}
95-
<img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.png" alt="logo"> {#- -#}
95+
<img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.svg" alt="logo"> {#- -#}
9696
{%- endif -%}
9797
</a> {#- -#}
9898
<nav class="sub"> {#- -#}

0 commit comments

Comments
 (0)