-
Notifications
You must be signed in to change notification settings - Fork 32
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
Language selector and absolute path #401
Comments
I have the same problem. The Website is not looking for the other languages in the configured subdirectories (presumably in the top-level of the html build, where your
I would expect to find the corresponding english side under:
Instead, this theme (with your configs) tries to load the following link:
I played a bit around with a local build myself and found it only to be working, if you config This is incompatible with how Are we missing something here, e.g. using a different way to build the languages? |
Try using relative paths in your html_theme_options = {
"languages": [
{
"name": "English",
"link": "../en/", # points to ./en/ subdirectory
"lang": "en",
},
{
"name": "French",
"link": "../fr/", # points to ./fr/ subdirectory
"lang": "fr",
},
]
} Now the language selector should point to the proper directory on your server. Using the language selectorThis theme's language button only directs the user to the site's landing page for the specified language ( |
Thanks for the advice. I had to make some ajustments to make this work:
|
Check your server's settings. I think there's usually an option to automatically resolve a directory's path to the
This is the exact reason why the current implementation only directs to the landing page. I think the upstream mkdocs theme has improved the JS to check existence of a sub-path when switching languages, but we haven't merged #338 yet due to other reasons. |
Hi,
I'm not quit sure to understand how to made the language selector working as it should.
i'm using
to build my translations.
Then my apache cordialy serve /var/www/html/ as https://bla.com/
My sphinx-immaterial is configure as :
It's correctly generate a drop-down menu with "English" and "French".
So when i go on the english page,
https://bla.com/en/
and then i choose French on the drop down menu , it redirect me tohttps://bla.com/en/fr/
, if i choose English, it redirect me tohttps://bla.com/en/en/
Same on the french page.
I tried
html_baseurl
on the sphinx side, orsite_url
on sphinx-immaterial options, but no luck.Can you point me something i'm missing ?
The text was updated successfully, but these errors were encountered: