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

Read the Docs one /_/ special URLs #214

Open
humitos opened this issue Aug 29, 2022 · 1 comment
Open

Read the Docs one /_/ special URLs #214

humitos opened this issue Aug 29, 2022 · 1 comment
Labels
Accepted Accepted issue on our roadmap Bug A bug

Comments

@humitos
Copy link
Member

humitos commented Aug 29, 2022

If you go to https://docs.readthedocs.io/en/stable/notfound and open the Javascript console you will see that the file https://docs.readthedocs.io/en/stable/_/static/javascript/readthedocs-doc-embed.js returned 404. For some reason, this URL is being changed when it should not.

The valid URL for this case is https://docs.readthedocs.io/_/static/javascript/readthedocs-doc-embed.js. Note that it does not include /en/stable/

Related to #200
Related to #206

@humitos humitos added Bug A bug Accepted Accepted issue on our roadmap labels Aug 29, 2022
@humitos
Copy link
Member Author

humitos commented Aug 29, 2022

The valid URL for this case is https://docs.readthedocs.io/_/static/javascript/readthedocs-doc-embed.js. Note that it does not include /en/stable/

I suppose the URL injected by Read the Docs may be relative and that's why it's not working...

I checked for this in the source code and I found the following:

  1. https://github.com/rtfd/readthedocs-sphinx-ext/blob/673fbb09a5d268e73bf79da4cee3a193eab115a0/readthedocs_ext/readthedocs.py#L82
  2. https://github.com/readthedocs/readthedocs.org/blob/3b487c9877f91e2e67eb9854729608233959d29d/readthedocs/doc_builder/backends/sphinx.py#L186
  3. https://github.com/readthedocs/readthedocs.org/blob/3b487c9877f91e2e67eb9854729608233959d29d/readthedocs/projects/models.py#L633-L636

Executing that on docs project:

In [2]: p = Project.objects.get(slug='docs')

In [4]: p.proxied_static_path
Out[4]: '/_/static/'

So, the final URL would be /_/static/javascript/readthedocs-doc-embed.js. That URL should be skipped by the extension, in theory, due to this code we added before: https://github.com/rtfd/sphinx-notfound-page/blob/6f01c89834f21643836ce40cbcb4e017152dd757/notfound/extension.py#L100-L102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug A bug
Projects
None yet
Development

No branches or pull requests

1 participant