Skip to content

Conversation

@ncclementi
Copy link
Contributor

Closes #592

I think the reason why this work and before it wasn't, is because what is on this PR matches the sphinx's builder sphinx-autobuild source build/html where outputs are *.html (e.g., platforms/brev-dev.html) rather than directories.

That being said. I'm still unsure if we want to keep this redirects, as I don't see how someone will purposely navigate to platforms/brev-dev. They'll have to type it or have it booked marked. But that's a separate discussion, happy to keep start a new issue if we want to discuss this.

@ncclementi ncclementi requested a review from a team as a code owner August 28, 2025 20:47
@jacobtomlinson
Copy link
Member

jacobtomlinson commented Sep 4, 2025

Oh I think I know what is going on here. In the main builds we are using the dirhtml builder. So platforms/brev-dev.md becomes platforms/brev-dev/index.html. But I think the dev/CI builds are using the html builder where platforms/brev-dev.md becomes platforms/brev-dev.html.

I think the redirects config are correct but the build preview commands are wrong.

I can confirm the brev redirect works for me if I run sphinx-autobuild -b dirhtml source build/html. We should update the build instructions. Annoyingly it's not possible to configure this via conf.py.

@ncclementi
Copy link
Contributor Author

🤔 But it's not working on the deployed docs. If you go to

https://docs.rapids.ai/deployment/stable/platforms/brev-dev/ it redirects to https://docs.rapids.ai/cloud/nvidia/brev/ with a Page Not Found.

Screenshot 2025-09-04 at 12 18 41 PM

@jacobtomlinson
Copy link
Member

jacobtomlinson commented Sep 4, 2025

Sure but that's a different problem where it doesn't know about the base URL. It is redirecting as expected, but to the wrong location relative to the final publishing URL. We can configure the base url in conf.py, but we only need to do that for the final builds, not development ones.

@ncclementi
Copy link
Contributor Author

Oh I see, is there a way of configuring the base url to be either stable/ or nightly/ depending on the situation? I haven't investigated this, but if you have any pointers I can try to work this one out.

@jacobtomlinson
Copy link
Member

I had a tinker with it this morning and I think the best solution here is to use relative paths in the redirect. This way it shouldn't matter whether the baseurl is https://docs.rapids.ai/deployment/stable/, https://docs.rapids.ai/deployment/nightly/ or http://localhost:8000/ as it will just walk back up the tree to the right relative point.

diff --git a/source/conf.py b/source/conf.py
index fef5089..f57f2c6 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -158,8 +158,8 @@ intersphinx_mapping = {
 }
 
 redirects = {
-    "platforms/brev-dev": "/cloud/nvidia/brev/",
-    "guides/l4-gcp": "/cloud/gcp/",
+    "platforms/brev-dev": "../../cloud/nvidia/brev/",
+    "guides/l4-gcp": "../../cloud/gcp/",
 }

@ncclementi
Copy link
Contributor Author

To check it works locally, build using dirhtml

sphinx-autobuild -b dirhtml source build/html 

@jacobtomlinson
Copy link
Member

Should we update docs to ensure we always mention sphinx-autobuild -b dirhtml source build/html . Unfortunately there's no way to configure this in conf.py to be the default, it always has to be specified as a CLI command.

@ncclementi
Copy link
Contributor Author

Updated the README to do the autobuild with dirhtml.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great thanks!

@jacobtomlinson jacobtomlinson merged commit a1de7a3 into rapidsai:main Sep 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix page redirects

2 participants