-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Online documentation version switcher #30062
Comments
I believe this is #24336 and rust-lang/cargo#1681 and also elements of #14466 So yeah, nothing exact, but similar. |
I'm working on #44687 currently. The demo site is http://rust-pull-request.s3-website-us-east-1.amazonaws.com/44687/std/ |
I don't think this needs to be a general purpose rustdoc feature, since docs.rs already shows different versions and you'll only ever have one version available locally. I do think this would be nice to have for the standard library though - I think that could be written with existing rustdoc features using
|
Mentoring instructions: First, write some JS that injects the right versions into the page, where the version number is now. Then, add it to the rust-lang/rust repo and add Line 430 in b7ebc6b
If that works well, we can figure out if and how to backport this to the existing documentation. |
@jyn514 I think one of the solutions currently being looked at is to use Lambda@Edge to inject a switcher on doc.rust-lang.org (see https://internals.rust-lang.org/t/adding-outdated-notices-to-archived-versions-of-documentation/12281/17 and #44687. This would allow switching for all pages (not just the std API). There are various issues with a javascript-only approach that a server-side approach would work better (viewing docs locally, handling new releases, etc.). |
Should this be closed in favor of #44687 then? |
I think so, since the RFC covers this. |
Hi, I'm astonished to not have found a similar issue, I apologize if it does exist but I didn't found it. I might have used the wrong terms.
It would be convenient in the online docs to turn the
div#versioninfo
into a doc version switcher.div#versioninfo
is this thing on the bottom right corner of documentations pages:At least a stable/nightly selector. I can imagine a switch between major versions later. It is not obvious for the newcomer what the URL scheme is. I just tried a few before figuring out it was
nightly
and notlatest
.You think might want also to set a
<link rel="canonical" href="http://doc.rust-lang.org/path/to/same/stable/page" />
to avoid google indexing the nightly too much, and also as the same page is available under/foo.html
andstable/foo.html
, that should (IIUC) de-duplicate search results and increase ranking.I'm not too sure of where to fix that, and where are all the valid urls published on docs.rust-lang.org.
Thanks.
The text was updated successfully, but these errors were encountered: