Closed agilgur5 closed 19 hours ago
site_url
is required for canonicalization and creating asitemap.xml
- Also for certain features like:
Ah I think site_url
was also required for to make 404 links (like https://argo-workflows.readthedocs.io/en/release-3.4/wrong) render CSS properly, and that was the original purpose of this PR, but I've forgotten what links I followed (went down a rabbit hole at the time). https://github.com/mkdocs/mkdocs/issues/2318 is related
Ah I think
site_url
was also required for to make 404 links (like https://argo-workflows.readthedocs.io/en/release-3.4/wrong) render CSS properly, and that was the original purpose of this PR, but I've forgotten what links I followed (went down a rabbit hole at the time).
Found it again: https://docs.readthedocs.io/en/stable/reference/404-not-found.html, under the MkDocs
tab:
MkDocs automatically generates a 404.html which Read the Docs will use. However, assets will not be loaded correctly unless you define the site_url configuration value as your site’s canonical base URL.
Motivation
site_url
is required for canonicalization, which is a prereq for proper styling on 404s and creating asitemap.xml
Also for certain features like:
Modifications
site_url
config tomkdocs.yml
Verification
mkdocs serve
http://127.0.0.1:8000/en/latest/
now -- workshttp://127.0.0.1:8000/en/latest/sitemap.xml
-- actually has content nowhttp://127.0.0.1:8000/en/latest/wrong
-- has a properly styled 404 page.Screenshot: