Skip to content

Commit d3b4e2a

Browse files
authored
Unrolled build for #146170
Rollup merge of #146170 - kumarUjjawal:master, r=Mark-Simulacrum fix: offline rustdoc html missing favicon As discussed in the #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" />
2 parents 2371802 + f3650b8 commit d3b4e2a

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,31 @@ impl Step for SharedAssets {
575575
FileType::Regular,
576576
);
577577

578+
builder.copy_link(
579+
&builder
580+
.src
581+
.join("src")
582+
.join("librustdoc")
583+
.join("html")
584+
.join("static")
585+
.join("images")
586+
.join("favicon.svg"),
587+
&out.join("favicon.svg"),
588+
FileType::Regular,
589+
);
590+
builder.copy_link(
591+
&builder
592+
.src
593+
.join("src")
594+
.join("librustdoc")
595+
.join("html")
596+
.join("static")
597+
.join("images")
598+
.join("favicon-32x32.png"),
599+
&out.join("favicon-32x32.png"),
600+
FileType::Regular,
601+
);
602+
578603
SharedAssetsPaths { version_info }
579604
}
580605
}

src/doc/favicon.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
1+
<link rel="alternate icon" type="image/png" href="favicon-32x32.png">
2+
<link rel="icon" type="image/svg+xml" href="favicon.svg">

src/doc/redirect.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<meta name="robots" content="noindex,follow">
2-
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
2+
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png">
3+
<link rel="icon" type="image/svg+xml" href="../favicon.svg">

0 commit comments

Comments
 (0)