Skip to content
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

Use link rel="canonical" to doc.rust-lang.org in HTML docs #18558

Closed
geofft opened this issue Nov 3, 2014 · 6 comments
Closed

Use link rel="canonical" to doc.rust-lang.org in HTML docs #18558

geofft opened this issue Nov 3, 2014 · 6 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@geofft
Copy link
Contributor

geofft commented Nov 3, 2014

I'm fairly often finding old versions of Rust docs from other sites when I Google things. For instance, searching for 'rust macro_rules' finds me http://web.mit.edu/rust-lang_v0.9/doc/guide-macros.html (as the second result, after the Rust by Example page), and the rust-lang.org page is nowhere to be found. Googling 'ContravariantLifetime' finds me http://www.contrib.andrew.cmu.edu/~acrichto/doc/std/kinds/marker/struct.ContravariantLifetime.html .

One way to avoid this going forward would be for the documentation included in release tarballs to use a <link rel="canonical"> tag pointing to the corresponding doc.rust-lang.org URL for that documentation page. This would allow the pages to be viewed directly without redirects (preserving local use), but any search engine juice would be repointed at the official URL.

See the following pages for discussion on canonical links:

The other option would be to include <meta name="robots" content="noindex"> in the documentation in tarballs, which would completely prevent them from getting indexed. This tag would of course need to not be in the doc.rust-lang.org version; I don't know if this would be difficult.

I could probably create a PR if that would be helpful, but I'm not at all familiar with the doc generation and release tarball creation process.

@steveklabnik
Copy link
Member

We already have an issue about this... But yes, big 👍

@geofft
Copy link
Contributor Author

geofft commented Nov 3, 2014

I see #9461, #12466, and #14466... maybe I'm misreading, but those seem to be about using <link rel="canonical"> from within doc.rust-lang.org to improve internal SEO when pages appear with multiple URLs (e.g., with /master/ and without).

To clarify, my request is specifically about including it in the documentation distributed outside doc.rust-lang.org (i.e., in the release tarballs and such), so that sites that semi-unintentionally host a copy of the docs point search engines back to doc.rust-lang.org. I don't think that's mentioned in those issues.

Feel free to close if I'm misreading or if there's another issue that I missed that covers this case.

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 27, 2015
@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Apr 20, 2015
@steveklabnik
Copy link
Member

Triage: no change.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@luser
Copy link
Contributor

luser commented Mar 1, 2018

Duplicate of #9461 ?

@jsha
Copy link
Contributor

jsha commented Nov 30, 2021

I think this issue has largely resolved itself - doc.rust-lang.org now ranks rather high. For instance, [rust macro_rules], the starting example here, now shows doc.rust-lang.org as the top two results.

@camelid
Copy link
Member

camelid commented Jan 9, 2022

Should this issue be closed then?

@jsha jsha closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants