Title: Add rel=canonical to most old html files. by Carreau · Pull Request #39 · matplotlib/matplotlib.github.com · GitHub
Open Graph Title: Add rel=canonical to most old html files. by Carreau · Pull Request #39 · matplotlib/matplotlib.github.com
X Title: Add rel=canonical to most old html files. by Carreau · Pull Request #39 · matplotlib/matplotlib.github.com
Description: rel=canonical is supposed to be helpful for search engine to know which pages a search engine should promote. This is not a redirect. If a file exists and is not in a versioned (x.y.z) folder; consider it as a potential "canonical" target If a file exist in a versioned doc of matplotlib make its rel=canonical point to the corresponding candidate. Example: path/to/foo.html -> candidate as being canonical 3.0.1/path/to/foo.html > set rel=canonical to matplotlib.org/path/to/foo.html Special case the examples and gallery folder. The examples folder is from old matplotlib version (2.0.2) but still quite popular on Google; special case. Apply the same rule as above but from withing examples toward gallery: /gallery/path/to/foo.html -> candidate as being canonical /example/path/to/foo.html > set rel=canonical to matplotlib.org/gallery/path/to/foo.html This took care of 145 files. Many examples were "moved" during examples -> gallery transition. If filename is unique in gallery; use this as a potential heuristic for detecting move: /gallery/path/to/verryuniquename.html -> candidate as being canonical as the filename is unique ! /example/old/location/verryuniquename.html > set rel=canonical to matplotlib.org/gallery/path/to/verryuniquename.html This took care of 185 files in example Leaving 271 "orphan" Resolve chain of rel-canonical. Fix links that point to example that themselves point to gallery. /gallery/path/to/verryuniquename.html /example/old/location/verryuniquename.html -> matplotlib.org/gallery/path/to/verryuniquename.html /2.0.2/example/old/location/verryuniquename.html -> should point to /example/.... make it point to /gallery/.... No files with existing rel=canonical have been touched. This will likely only affect pre-3.0 documentation files. Obviously scripted, but kind of ugly: https://gist.github.com/Carreau/d2b3e36b65d4155827539ef462860444 I paid attension to avoid doing any other changes than adding a single line to target files; so can try to do changes.
Open Graph Description: rel=canonical is supposed to be helpful for search engine to know which pages a search engine should promote. This is not a redirect. If a file exists and is not in a versioned (x.y.z) folder; con...
X Description: rel=canonical is supposed to be helpful for search engine to know which pages a search engine should promote. This is not a redirect. If a file exists and is not in a versioned (x.y.z) folder; con...
Opengraph URL: https://github.com/matplotlib/matplotlib.github.com/pull/39
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2f530283-757a-415b-f426-c19ffcc3e99d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E692:17AA66:DD93D0:12D8B6D:6A51FBA4 |
| html-safe-nonce | 26b1af3dc900d8d67890b2f6717ab74692c89975e9296088e500fa45f2a87fb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjkyOjE3QUE2NjpERDkzRDA6MTJEOEI2RDo2QTUxRkJBNCIsInZpc2l0b3JfaWQiOiIxNjc5MzA5NTI4NTAyNTAwMjYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2df6dbdca34fca6b85aeb519d993e4bcdb29fc57ba24c0bc6ae0b492702a62f9 |
| hovercard-subject-tag | pull_request:302219135 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib.github.com/pull/39/files |
| twitter:image | https://avatars.githubusercontent.com/u/335567?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/335567?s=400&v=4 |
| og:image:alt | rel=canonical is supposed to be helpful for search engine to know which pages a search engine should promote. This is not a redirect. If a file exists and is not in a versioned (x.y.z) folder; con... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib.github.com git https://github.com/matplotlib/matplotlib.github.com.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385150 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib.github.com |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385150 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib.github.com |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width