-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Examples in docs should be redirected to latest version number #12374
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
The problem with that is what you can currently observe already when searching on google: It'll find old pages for you, because those are the ones most links direct to. (e.g. google "matplotlib+imshow+example"). Relevant: #10016 and #10854 |
So ideally the non versioned link would link to the latest available version of a page. Not sure if you can do that with some sort of fancy redirect. |
Would it be possible to add noindex to older versions of the docs? That would prevent google from showing these results. On the downside, we would have to modify all doc pages once a newer version comes out. |
I would suggest using robots.txt (which currently doesn't exist). If you put all your docs in directories named after the version /docs/3.0.2/ and then only allow robots to crawl the /current/ edition (which is just an invisible pointer to /3.0.2/ for instance), that would go a long way to reducing end-user discovery of old docs. The old versions would remain perpetually available for links. |
So on other projects, the RTD theme has an option {'canonical_url': 'https://matplotlib.org/latest/'} though that would require us to have something like https://matplotlib.org/ work as a root for the latest for all doc pages--I'm not sure if that's the case. I'm also not sure if the |
I think #13592 was incorrect, and canonical should point to our top level. I think we should also have a sitemap.xml that puts a lower weight on the old versions versus the current one. Do we have anyone who knows enough about how to do this automatically? Maybe using this extension: https://github.com/jdillard/sphinx-sitemap |
Re-milestoning because our search results are really all over the place. |
See matplotlib/matplotlib.github.com#47 for most of this.... |
See matplotlib/matplotlib.github.com#48 for an alternative to matplotlib/matplotlib.github.com#47 @floggle Do you have SEO experience? Is matplotlib/matplotlib.github.com#48 what you were suggesting? Note the sitemap.xml down-weights the old versions, versus hiding them. We could also hide the old versions and only allow |
Originally posted by @anntzer in #12244 (comment)
There's no redirection right now. I think we should redirect matplotlib.org/gallery/... to matplotlib.org/$version/gallery/... (which is what cpython does) so that people don't bookmark links that will be broken in the future, but that's a wholly separate issue...
The text was updated successfully, but these errors were encountered: