-
Notifications
You must be signed in to change notification settings - Fork 34
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
Problem with sub-projects #171
Comments
This is definitely not great 😄 However, I'm not sure how the sphinx-notfound-page extension could help here. It needs to know the URL path where it will be served to hardcode the links and resources. There should be a hacky way to solve this with and embed Javascript in the extension, I suppose. It could parse the full URL as On the other hand, I thought Read the Docs weren't supporting 404 pages on subprojects, actually. See this issue that I opened some time ago there: readthedocs/readthedocs.org#5557 I'm not sure a clean way to solve this problem currently, even if Read the Docs picks the correct |
Thanks I hadn't seen that issue on Read the Docs. I can see the problem with the general case. I wonder if would be possible for the sphinx-notfound-page extension to be configured to always go to the 404 page for the root project — that would suit me (all the subproject are set up with identical 404 pages, anyway). |
I have a problem using the extension with sub-projects on readthedocs, and versioned sub-projects in particular.
For example, it partly works with “latest”: https://docs.graphcore.ai/projects/available-memory/en/latest/xyz.html
The images and styles are present (because they are picked up from the root project).
But the navigation links don’t work (they go to the root project and hence the root 404 page, which is kinda OK but not ideal)
On version branches the images and styles are not found because there is no equivalent version in the root project (e.g. it is linking to
/en/1.0.0/_static/css/theme.css
)For example: https://docs.graphcore.ai/projects/available-memory/en/1.0.0/xyz.html
So, apparently, I need to set the UL prefix correctly. I tried the following settings:
Setting
notfound_urls_prefix = "/"
ornotfound_urls_prefix = None
results in exactly the same behaviour as the default setting, including for "latest" as well as versions.Always go to the parent project for resources and links
This makes the versions act like “latest”. So the page looks OK, but the links are not correct.
For example: https://docs.graphcore.ai/projects/available-memory/en/2.1.0/xyz.html
In this case, everything works exactly as expected. Page looks correct and the links are correct.
For example: https://docs.graphcore.ai/projects/available-memory/en/2.2.0/xyz.html
However, this means that
notfound_urls_prefix
needs to be set specifically for every project and version. Which is doable (I already have to customiseconf.py
for each document) but it would be nicer if I didn't have to.So I wonder if there is a better way?
Versions:
The text was updated successfully, but these errors were encountered: