-
Notifications
You must be signed in to change notification settings - Fork 212
Better documentation for docs.rs/:crate/latest #854
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
Comments
This is one of our earliest features: |
Currently our robots.txt is almost blank 😅 it would be good to clean it up. There's a guide at https://support.google.com/webmasters/answer/6062596?hl=en&ref_topic=6061961 that looks useful, with a full reference here (see especially the bit about matching based on path values). |
The go to latest version should redirect to that page. And I think that it would naturally increase the score of that page (since that page would be linked by many other page) that would naturally push the latest version at the top of the result of search engine. |
That page is itself a redirect so that we can avoid caching the latest page (imagine: someone goes to 1.0, they 'go to latest version' which is 2.0, now 3.0 is published but |
I think pretty much all we can do is mess with what search engines index, I've personally run into stale doc links (read: not latest) on searches and that'd be a good enhancement going forward. As for documenting it, I think it's really documented as well as it can be, and adding even more redirect logic than we have to doesn't sound fun and would require (most likely) another request to S3 which isn't ideal for what's already our slowest page class. While looking at this I also noticed that our sitemap uses urls in the |
It's wild idea, feel free to reject it (and anyway I don't think have the competences to do it myself). Each time a new version it published, two set of pages would be generated:
This means the following things would change:
This means that most of the time people would use |
This is not a workable solution, it would double our storage costs. What we could do instead is serve |
I think this is the right approach, and the version is already included in the heading anyway. Regarding search engines, we could include a <link rel="canonical" href="https://docs.rs/{crate}/latest/{path}"> |
Ok, it shouldn't be too hard to implement then. I don't think we want to make |
It wouldn't. The
|
Hmm? There is supposed to be only a single canonical version of each page.
Well the easier solution here is to just treat
I'm not sure I follow the question: if we implement
Well, it will point to the latest version, as you're visiting |
I think it's also worth mentioning that when you go to old docs there's a |
When appropriate I frequently actually deliberately forge links without the version in the URL because I want my link to hit the redirect and thus the latest version. "Don't implement a path because it might 404 later" cuts against all existing paths on docs.rs as well. |
One option to improve the 404 situation might be to redirect to a search page if using a non-exact version and the page does not exist in the resolved version, similar to how "go to latest version" works (which would then make "go to latest" act pretty much the same as redirecting to |
Another one would be to have a link that automatically redirect to the latest version, unless the page doesn't exists anymore, and then it would give the original page. Something like "https://docs.rs/{crate}/latest/{path}?original_version=1.0.38" or "https://docs.rs/{crate}/latest/{path}/1.0.38". |
I'm going to close this as a duplicate of #1438. |
Currently urls looks like this:
https://docs.rs/$crate/$version/$crate/$page.html
. I propose that it should be possible to use the following aliashttps://docs.rs/$crate/$page.html
. This page would just always displays the docs of the latest version of the crate.robot.txt
that only those pages should be indexed and not the one with explicit version numbers (so all indexed pages would always points to the latest version, instead of (usually) outdated ones).The text was updated successfully, but these errors were encountered: