Repository navigation
Fix broken sitemap and canonical URLs in docs - #263
Merged
Merged
Conversation
All sitemap links and page canonical links pointed to /latest/3.x/, which is a 404. site_url ended in /latest/ and mike added the version folder on top. Now site_url is the site root and mike uses canonical_version: latest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All 101 links in https://dartondox.dev/latest/sitemap.xml give a 404, for example
https://dartondox.dev/latest/3.x/. The canonical link on every page has the same wrong path. So search engines are sent to pages that do not exist.Cause
site_urlended in/latest/. mike adds the version folder on top, so URLs became/latest/3.x/....Fix
site_urlis now the site root:https://dartondox.dev/.The mike plugin has
canonical_version: latest, so the sitemap and canonical links use/latest/....The sitemap is now also at https://dartondox.dev/sitemap.xml. `ci/docs_redirects.py` copies it from `/latest/` to the site root, and `robots.txt` points to it.
Checked
Local
mike deployinto a throwaway branch: sitemap and canonical links arehttps://dartondox.dev/latest/....mkdocs build --strictpasses.Ran `ci/docs_redirects.py` on a fake gh-pages folder: it writes `/sitemap.xml`, and `robots.txt` points to it.