-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Proxito: redirect to default version from root language #10313
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
Conversation
docs/user/user-defined-redirects.rst
Outdated
as set in your project settings. | ||
|
||
This works for readthedocs.io (|org_brand|) and :doc:`custom domains </custom-domains>`. | ||
For |com_brand| this can be enabled by contacting :doc:`support </support>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is since this "feature" is only available when using the new proxito implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!! Happy to close an old issue so efficiently.
I wondered about cases where a project contains:
a) No translations
b) A file called /es/test.html
c) ..or maybe a file called /es/latest/test.html
But I concluded that we aren't raising the "TranslationNotFound" error unless the path also doesn't exist? Is that correct?
"/en", | ||
"/en/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Not sure if I understand the question, but for the cases that you listed: a) No translations: since the project doesn't have translations (just an en language), a |
Co-authored-by: Benjamin Balder Bach <[email protected]>
If a project is a multiversion project, it cannot use paths like I'm wondering if strictly always resolving We can definitely treat this as a separate issue. |
If a project is a multiversion project, it always needs to serve a file from a language subpath. If it's a single version project it can have any path in the url, it will resolve just fine. |
Garh of course 🤦 I managed to ask a very silly question. I think where I got it wrong initially was thinking that we do redirects to a default language like how Django i18n url patterns does. Which we don't - we use our own /page redirects. I don't have anymore inputs or questions :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the whole work you have done on El Proxito lately. This PR is a lot easier to review now that we all have a better understanding of how things work.
docs/user/user-defined-redirects.rst
Outdated
A link to the root language of your documentation (``<slug>.readthedocs.io/en/``) | ||
will redirect to the :term:`default version` of that translation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A link to the root language of your documentation (``<slug>.readthedocs.io/en/``) | |
will redirect to the :term:`default version` of that translation. | |
A link to the root language of your documentation (``<slug>.readthedocs.io/<lang>/``) | |
will redirect to the :term:`default version` of that language. |
docs/user/user-defined-redirects.rst
Outdated
|
||
Root language redirects on |com_brand| can be enabled by contacting :doc:`support </support>`. | ||
|
||
For example:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example:: | |
For example, accessing the English language of the project will redirect you to the ``stable`` version:: |
"/en", | ||
"/en/", | ||
] | ||
for path in paths: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a for
here, shouldn't these be pytest.parametrize
? (I know you love that one 😉 ). It would be clearer when the test fail to know what is the exact case we are testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note there are more cases like this in the other tests we can change to pytest.parametrize
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think parametrize doesn't work with tests that inherit from TestCase
, I'll give it a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, they don't work there https://docs.pytest.org/en/latest/how-to/unittest.html#pytest-features-in-unittest-testcase-subclasses.
Closes #2968