-
Notifications
You must be signed in to change notification settings - Fork 3
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
Capture source path segment and append to destination path #63
base: main
Are you sure you want to change the base?
Capture source path segment and append to destination path #63
Conversation
I have created this PR because I don't know how I can get the "dev" MakeTheDocs site to pull from an arbitrary, non- I will check with @yxu-lanl about the possibility of deploying this PR branch to the development documentation site. |
I found a way I could deploy this to https://dev-nmdc-documentation.readthedocs.io for testing, without merging it into Unfortunately, I misunderstood how the "capturing" of the As a result, instead of https://dev-nmdc-documentation.readthedocs.io/en/dev/reference/metadata/xylene.html redirecting to https://w3id.org/nmdc/Study, it redirects to https://w3id.org/nmdc/reference/metadata/Study (which is not what I want to happen). |
There's already an issue about this behavior, in the plugin's GitHub repo: documatt/sphinx-reredirects#2 |
I commented on that issue. I'll keep this code in a draft PR for now. I have "unassigned" all the reviewers as I'm not ready for this to be merged in anymore. |
After having checked the source code of the Sphinx plugin that handles redirects, I am not confident the plugin will be updated to capture the portion of the URL that matches the As an alternative, we could add a |
In this branch, I deleted the two original redirects that existed and replaced them with a new one. The new one is designed to capture the portion of the original URL following
/reference/metadata
and append it tohttps://w3id.org/nmdc/
, and then redirect the user to the resulting URL.For example: If a user visits https://nmdc-documentation.readthedocs.io/en/latest/reference/metadata/xylene.html, I designed the redirect to redirect them to https://w3id.org/nmdc/xylene (which will, in turn, redirect them to https://microbiomedata.github.io/nmdc-schema/xylene/).
I am not sure this redirection plugin supports having a combination of wildcard and non-wildcard sources, which is what the two original redirects—together—were. It may be the case that the wildcard overrode any other sources. This is not addressed in the plugin's documentation.