Add English i18n support with mkdocs-static-i18n

- Add mkdocs-static-i18n to requirements.txt
- Configure i18n plugin: zh (default) at root, en/ subfolder
- Add language switcher (alternate) in extra config
- Disable navigation.instant (incompatible with i18n switcher)
- Add nav_translations for all category labels in English
- Update readme-generate.js: dish/tip nav entries use path-only
  (mkdocs auto-uses page heading = English title for /en/ pages)
- en/ folder to be populated by dotlang translation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anduin Xue
2026-05-04 13:42:42 +00:00
parent d541fd425d
commit 3bb7159bf8
4 changed files with 447 additions and 378 deletions

View File

@@ -235,7 +235,7 @@ function categoryReadmeTemplate(title, inlineStr) {
}
function inlineMkdocsTemplate(file, path, isDish = false) {
return `${' '.repeat(isDish ? 10 : 6)}- ${file.replace('.md', '')}: ${path}/${file}\n`;
return `${' '.repeat(isDish ? 10 : 6)}- ${path}/${file}\n`;
}
function categoryMkdocsTemplate(title, inlineStr) {