You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The canonical link tag is not outputted when we build locally with make dirhtml, though.
I'd like to reproduce the behavior reported on this issue locally. That will help us to debug the problem in an easier way. However, I wasn't able to do this.
I added the following to the conf.py trying to reproduce this problem and I couldn't:
Problem
For https://cs50.readthedocs.io/, the source for which is at https://github.com/cs50/cs50.readthedocs.io, we're using Sphinx HtmlDir at https://readthedocs.org/dashboard/cs50/advanced/, so that our URLs are of the form, e.g.,
https://cs50.readthedocs.io/code/
instead ofhttps://cs50.readthedocs.io/code.html
.However, we noticed that
sphinx_rtd_theme==1.0.0
is still outputtingper
https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html#L52-L55
which we gather might be happening because
conf.py.tmpl
is settingcanonical_url
at https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl#L98. (Somehow, at least,theme_canonical_url
is being set but notpageurl
.) The result is that, e.g., Chrome on iOS, when you click the Share icon, copies that URL to the user's clipboard rather than the HtmlDir version thereof, so the recipient ends up with a 404.The canonical
link
tag is not outputted when we build locally withmake dirhtml
, though.Reproducible Project
https://cs50.readthedocs.io/code/
Error Logs/Results
Expected Results
Build should be outputting HtmlDir-style canonical URLs like:
Environment Info
sphinx_rtd_theme==1.0.0
The text was updated successfully, but these errors were encountered: