Skip to content

Examples in docs should be redirected to latest version number #12374

Closed
matplotlib/matplotlib.github.com
#49

Description

@jklymak

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...

Activity

  1. added this to the v3.1 milestone on Oct 2, 2018
  2. ImportanceOfBeingErnest commented on Oct 2, 2018

    @ImportanceOfBeingErnest
    Member

    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

  3. jklymak commented on Oct 2, 2018

    @jklymak
    MemberAuthor

    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.

  4. timhoffm commented on Oct 3, 2018

    @timhoffm
    Member

    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.

  5. floggle commented on Jan 17, 2019

    @floggle

    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.

  6. timhoffm commented on Jan 19, 2019

    @timhoffm
    Member

    Does somebody know if it's possible to integrate the version picker from readthedocs into other sites?
    grafik

    IMHO that would really help with version confusion.

  7. dopplershift commented on Jan 21, 2019

    @dopplershift
    Contributor

    So on other projects, the RTD theme has an option canonical_url that can be used to set a path to the version we want crawled--it adds links with the rel="canonical" attribute that apparently tells the crawlers what we want. I set it in conf.py as, e.g.:

    {'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 canonical_url is a standard option or if it could easily be grafted onto our theme.

  8. modified the milestones: v3.1.0, v3.2.0 on Mar 18, 2019
  9. jklymak commented on Jan 17, 2021

    @jklymak
    MemberAuthor

    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

  10. modified the milestones: needs sorting, v3.4.0 on Jan 17, 2021
  11. jklymak commented on Jan 17, 2021

    @jklymak
    MemberAuthor

    Re-milestoning because our search results are really all over the place.

  12. jklymak commented on Jan 18, 2021

    @jklymak
    MemberAuthor

    See matplotlib/matplotlib.github.com#47 for most of this....

  13. jklymak commented on Jan 19, 2021

    @jklymak
    MemberAuthor

    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 /stable/...

  14. jklymak commented on Feb 1, 2021

    @jklymak
    MemberAuthor
  15. modified the milestones: v3.4.0, v3.4.1 on Feb 1, 2021
  16. modified the milestones: v3.4.1, v3.4.0 on Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions