Skip to content

Problem with sub-projects #171

@JamesRandom

Description

@JamesRandom

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:

  1. Setting notfound_urls_prefix = "/" or notfound_urls_prefix = None results in exactly the same behaviour as the default setting, including for "latest" as well as versions.

  2. Always go to the parent project for resources and links

notfound_urls_prefix = "/en/latest/"

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

  1. Always go to the correct project and version for resources and links
notfound_urls_prefix = "/projects/available-memory/en/2.2.0/“

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 customise conf.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:

  • Sphinx==3.4.3
  • sphinx_rtd_theme==0.5.1
  • docutils==0.16
  • sphinx-notfound-page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions