Replies: 4 comments 2 replies
-
Hello @ittuann,
I believe the issue is a lack of configured By default it expects the page to be located at site_url: https://ittuann.github.io/Awesome-IntelligentCarRace/ to your |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response and advice! I followed the documentation to use the Built-in info plugin to generate this zip file:
For I created As for why the mkdocs.yml isn't included in the zip, I'm not quite sure what happened. |
Beta Was this translation helpful? Give feedback.
-
OK, my mistake. Looking at the mkdocs-material/src/templates/partials/alternate.html Lines 35 to 45 in 6b690e9 I thought that the url Jinja function would handle the site_url , but it turned out to be a feature of the i18n plugin:https://github.com/ultrabug/mkdocs-static-i18n/blob/5f97ac28b9f67a3db0f196edf2a1a0059b718213/mkdocs_static_i18n/reconfigure.py#L334-L337 Therefore, currently you could set it like so: alternate:
- name: Chinese
link: /Awesome-IntelligentCarRace/
lang: zh
- name: English
link: /Awesome-IntelligentCarRace/en/
lang: en However, this setting is global for the build, as in, once it starts to work as intended for GitHub Pages with the As for the mkdocs-material/src/plugins/info/plugin.py Lines 117 to 120 in 6b690e9 TBH your approach of putting the mkdocs.yml file in the docs directory seems rather non-standard.
I will later make a PR to use the |
Beta Was this translation helpful? Give feedback.
-
Thanks for debugging this, @kamilkrzyskow, and thanks to @ittuann for reporting and providing the reproduction. This issue looks like a problem with configuration, because the alternate links receive the wrong bases. I'm moving this to a discussion.
There are some problems with the info plugin and multi-project builds. We'll try to fix them in the coming weeks, as we're starting to provide starter templates for multi-project builds, e.g., multilingual docs etc. So it's kind of an issue, albeit currently rather minor, but we should fix it nonetheless. PRs appreciated! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
No response
Bug description
On GitHub Pages for repository projects (not personal sites like
username.github.io
), the Site Language Selector fails to redirect correctly. This issue is not occur for the same projects when they are deployed on Vercel or Netlify domains, even though they are also based on the same gh-pages branch.When selecting a language from the navigation bar's Site Language Selector, the following behavior is observed:
Chinese
(default website language):English
:Related links
Reproduction
9.5.2-site-language-selector.zip
This Github Pages in the repository are all automatically built using GitHub Actions. If needs to track down additional issues or diagnose problems, refer to the workflow configuration files and logs of GitHub Actions, which may help you in understanding and reproducing the issue.
Steps to reproduce
When selecting a language from the navigation bar's Site Language Selector, the following behavior is observed:
Select
Chinese
(default website language):Select
English
:Expected Behavior
Select
Chinese
:https://ittuann.github.io/Awesome-IntelligentCarRace/ -> https://ittuann.github.io/Awesome-IntelligentCarRace/
The URL remain https://ittuann.github.io/Awesome-IntelligentCarRace/ for the GitHub Pages site of this repository.
Select
English
:Browser
No response
Before submitting
Beta Was this translation helpful? Give feedback.
All reactions