Skip to content
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

ENH: link stable sitemap #48

Merged
merged 5 commits into from Jan 21, 2021
Merged

Conversation

@jklymak
Copy link
Contributor

@jklymak jklymak commented Jan 19, 2021

Much pared-down version of #47.

Instead of redirecting the whole root tree, it now simply takes root out of the canonical search path in sitemap.xml and robots.txt, and instead suggests going to the softlinked stable->3.3.3. sitemap.xml and robots.txt would need to be manually updated at release (though robots.txt should be fine until Matplotlib 6).

Todo:

  • canonical links will still need to point to matplotlib.org/stable/
jklymak added 3 commits Jan 19, 2021
FIX
@jklymak jklymak force-pushed the jklymak:enh-link-stable-sitemap branch from ad3532f to 1051ec9 Jan 19, 2021
@jklymak
Copy link
Contributor Author

@jklymak jklymak commented Jan 19, 2021

Someone who understands sitemap.xml and robots.txt better than me should definitely jump in here if they don't think this will work....

@jklymak
Copy link
Contributor Author

@jklymak jklymak commented Jan 19, 2021

BTW do we want /stable/ or /latest/? I guess I like /stable/ as a parallel to /dev/ however, I probably typed /latest/ 50% of the time working on this...

@dstansby
Copy link
Member

@dstansby dstansby commented Jan 19, 2021

BTW do we want /stable/ or /latest/? I guess I like /stable/ as a parallel to /dev/ however, I probably typed /latest/ 50% of the time working on this...

Definitely stable, by default on readthedocs (which many many many python projects use) stable means the latest release, and latest means the latest commit on the main branch.

p.s. I'm half following all of this, thanks a lot for the PRs!

@jklymak jklymak force-pushed the jklymak:enh-link-stable-sitemap branch from 2df234b to e0a5434 Jan 19, 2021

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://matplotlib.org/stable/</loc>

This comment has been minimized.

@jklymak

jklymak Jan 19, 2021
Author Contributor

Note these should really have a <last-modified> tag, but I think they will work without.

@jklymak jklymak linked an issue that may be closed by this pull request Jan 19, 2021
@jklymak
Copy link
Contributor Author

@jklymak jklymak commented Jan 19, 2021

A way forward to redirect root level instead of replacing root level by soft links to stable (#47) would be to figure out the newest version (usual stable, but other versions if the file is now removed) and replace all the root level html files with a refresh:

<!DOCTYPE HTML>                                                                 
<html lang="en">                                                                
    <head>                                                                      
        <meta charset="utf-8">
        <meta http-equiv="refresh" content="0;url={{NEWEST_VERSION}}/PATH" />       
        <link rel="canonical" href="{{NEWEST_VERSION}}/PATH" />                     
    </head>                                                                                                                                                                   
    <body>                                                                      
        <h1>                                                                    
            The page been moved to <a href="{{NEWEST_VERSION}}/PATH"</a>
        </h1>                                                                   
    </body>                                                                     
</html>

Yet another option is change the hosting from GitHub pages, and be able to include our own .htaccess

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Jan 20, 2021

This seems pretty reasonable, but all I did was read the docs that you linked, so I don't know about the SEO implications.

You may have missed a few project subdirectories:

  • /matplotblog definitely should be crawled
  • /pytest-mpl has a gh-pages branch, but seems to be broken
  • /basemap maybe should still be crawled
  • /cycler should be crawled
  • /mpl-altair might be a bit dead, but can still be crawled
  • /mpl-bench needs to be automated, but can be crawled
  • /devdocs could be crawled, but should be marked as updated daily at least

I have some ideas of how to proceed on the redirects now, but no time to try them just yet. Maybe after the 3.4.0 release candidate.

@jklymak
Copy link
Contributor Author

@jklymak jklymak commented Jan 20, 2021

Great I can add those. But how do you know those are all there? I can see how the main docs are built, but how do the other ones get injected? Do they just have GitHub pages that deploy onto ours?

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Jan 20, 2021

Any repo at github.com/USER/REPO deploys to USER.github.io/REPO when it has a gh-pages branch. We just also have a CNAME setup to use matplotlib.org instead of USER.github.io. I'm not actually sure what happens if the main site has a page called REPO that would shadow the repo-specific one.

@jklymak jklymak mentioned this pull request Jan 21, 2021
@tacaswell tacaswell merged commit 17652c7 into matplotlib:master Jan 21, 2021
1 check passed
1 check passed
LGTM analysis: Python No code changes detected
Details
@jklymak jklymak deleted the jklymak:enh-link-stable-sitemap branch Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants