-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
subprojects: Search returns broken links when used from subproject subdomain #7487
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
Comments
Thanks for reporting! This is because our resolver always resolves to the canonical domain. We could solve this by:
I think |
I would just like to point out that if one goes with the solution that ends up returning the link The same is probably not true for P.S. Thanks a lot for looking into this! |
Removing the subproject will break the links yes, but you can create a redirect for it if that happens https://docs.readthedocs.io/en/latest/user-defined-redirects.html |
Thanks, it might actually be useful to add this case as an example to the docs of the exact redirects.
|
@ericholscher @stsewd I guess what remains here is to decide among the options listed by @stsewd . I withdraw my concern with option C (links breaking when a subproject moves away from a parent project). In this scenario, any link that includes the parent project prefix will break (not just the ones returned by search) and, as pointed out by @stsewd, this can be mitigated via setting up a redirect (edit: not quite true, the It would, however, be important for us to fix the broken links in the search results (one way or another), since our users keep encountering this. |
Ping |
Hello @ericholscher @stsewd ; I am working with @ltalirz in aiida. We were wondering if there was any news regarding this issue. Would you know if you would be making a decision soon? It would really help us to have this sorted out. If you need any other information to make the decision, or maybe some help afterwards implementing the changes, we might be able to collaborate or lend a hand. Let us know! In the meantime: do you have any suggestions as to how we could temporarily patch this on our end? |
@stsewd I'm fine with C here. We should definitely be creating links that always work properly I think. Tricky problem :/ |
Ok, we should add the redirect in proxito, hopefully it doesn't add another query for normal projects. |
@stsewd I don't think we want to redirect, do we? Don't we just want to create the link with the full URL if the current domain doesn't match? |
Oh I see what you mean -- actually redirect all URL's on the subproject to the subproject domain? Not just search results? |
I think as a first step we should make sure we aren't generating broken search results, so lets do A first, and then work on C since that's a larger project. |
Ok, got it! |
If we don't have a ticket for it, we should open one for properly redirecting subproject URL's though. 👍 |
Interestingly, if you hit the root domain, it already does this:
But not for actual file serving requests.
|
Details
readthedocs.org allows to configure projects as subprojects of other projects.
In this example "aiida-core" is configured as a subproject of "aiida".
With the current default settings, going to the root url of the subproject, i.e. https://aiida-core.readthedocs.io, actually redirects automatically to https://aiida.readthedocs.io/projects/aiida-core/en/latest/.
On the aiida. subdomain everything works fine.
Via direct links such as https://aiida-core.readthedocs.io/en/latest/, however, one can still end up on the subproject domain (and there are a number of such links to our project documentation on the web.).
If one now uses the search field (e.g. for "batch scheduler"), the search results contain broken links of the form
https://aiida-core.readthedocs.io/projects/aiida-core/en/latest/topics/schedulers.html?highlight=batch%20scheduler
I.e. the links contain the subproject path but with the aiida-core subdomain. The correct link would be:
https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/schedulers.html?highlight=batch%20scheduler
Edit: or, alternatively:
https://aiida-core.readthedocs.io/en/latest/topics/schedulers.html?highlight=batch%20scheduler
Expected Result
Search results should not contain broken links, independently of whether search is used on the "parent" project subdomain or on the "child" project subdomain.
Actual Result
Search results on the "child" project subdomain (aiida-core) contain broken links.
The text was updated successfully, but these errors were encountered: