Rollup merge of #146170 - kumarUjjawal:master, r=Mark-Simulacrum

fix: offline rustdoc html missing favicon

As discussed in the rust-lang/rust#146149 the doc was missing the favicon icon when build locally and viewed on a browser. I changed the relative path and also now we explicitly copy both SVG and PNG.

<img width="1132" height="425" alt="Screenshot 2025-09-03 at 11 57 46 PM" src="https://github.com/user-attachments/assets/062cbb08-04ec-4d88-a43a-710fb6190f82" />
This commit is contained in:
Matthias Krüger 2025-09-07 20:02:27 +02:00 committed by GitHub
commit cb64a77550
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 2 deletions

View file

@ -575,6 +575,31 @@ impl Step for SharedAssets {
FileType::Regular,
);
builder.copy_link(
&builder
.src
.join("src")
.join("librustdoc")
.join("html")
.join("static")
.join("images")
.join("favicon.svg"),
&out.join("favicon.svg"),
FileType::Regular,
);
builder.copy_link(
&builder
.src
.join("src")
.join("librustdoc")
.join("html")
.join("static")
.join("images")
.join("favicon-32x32.png"),
&out.join("favicon-32x32.png"),
FileType::Regular,
);
SharedAssetsPaths { version_info }
}
}

View file

@ -1 +1,2 @@
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
<link rel="alternate icon" type="image/png" href="favicon-32x32.png">
<link rel="icon" type="image/svg+xml" href="favicon.svg">

View file

@ -1,2 +1,3 @@
<meta name="robots" content="noindex,follow">
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png">
<link rel="icon" type="image/svg+xml" href="../favicon.svg">