Skip to content

Commit 3747868

Browse files
Rollup merge of #59197 - kornelski:redir, r=steveklabnik
Exclude old book redirect stubs from search engines Adds `<meta name="robots" content="noindex,follow">` to the `<head>` of old stub pages pointing to the second edition of the book. This is continuation of rust-lang/book#1788
2 parents 5f390f7 + 8b5a748 commit 3747868

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/bootstrap/doc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ fn invoke_rustdoc(
331331

332332
let path = builder.src.join("src/doc").join(markdown);
333333

334-
let favicon = builder.src.join("src/doc/favicon.inc");
334+
let header = builder.src.join("src/doc/redirect.inc");
335335
let footer = builder.src.join("src/doc/footer.inc");
336336
let version_info = out.join("version_info.html");
337337

@@ -341,7 +341,7 @@ fn invoke_rustdoc(
341341

342342
cmd.arg("--html-after-content").arg(&footer)
343343
.arg("--html-before-content").arg(&version_info)
344-
.arg("--html-in-header").arg(&favicon)
344+
.arg("--html-in-header").arg(&header)
345345
.arg("--markdown-no-toc")
346346
.arg("--markdown-playground-url")
347347
.arg("https://play.rust-lang.org/")

src/doc/redirect.inc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<meta name="robots" content="noindex,follow">
2+
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">

0 commit comments

Comments
 (0)