Skip to content

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

Closed
@geofft

Description

@geofft

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions