Skip to content

add sitemap to rust docs #139593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl Step for Docs {
tarball.set_product_name("Rust Documentation");
tarball.add_bulk_dir(builder.doc_out(host), dest);
tarball.add_file(builder.src.join("src/doc/robots.txt"), dest, FileType::Regular);
tarball.add_file(builder.src.join("src/doc/sitemap.txt"), dest, FileType::Regular);
Some(tarball.generate())
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/doc/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Disallow: /beta/book/first-edition/
Disallow: /beta/book/second-edition/
Disallow: /nightly/book/first-edition/
Disallow: /nightly/book/second-edition/

Sitemap: https://doc.rust-lang.org/sitemap.txt
4 changes: 4 additions & 0 deletions src/doc/sitemap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://doc.rust-lang.org/stable/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimming through https://en.wikipedia.org/wiki/Sitemaps it seems like this needs to be an XML file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plaintext is an alternate, simpler format that should be sufficient for our needs.

https://en.wikipedia.org/wiki/Sitemaps#Text_file

https://doc.rust-lang.org/beta/
https://doc.rust-lang.org/nightly/

Loading