diff --git a/docs/config.yml b/docs/config.yml index 970aafca..974db50b 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -32,10 +32,10 @@ extra: link: /pt/ lang: pt - name: 中文(简体) - link: /zh-cn/ + link: /zh_CN/ lang: zh-Hant - name: 中文(繁體) - link: /zh-tw/ + link: /zh_TW/ lang: zh-TW social: - icon: fontawesome/brands/github @@ -146,3 +146,15 @@ plugins: literate-nav: nav_file: SUMMARY.md macros: {} + redirects: + redirect_maps: + # Old + "en/latest/tutorial/tutorial-1.md": "tutorial/tutorial-1.md" + "en/latest.md": "index.md" + "de/latest.md": "https://tutorial.beeware.org/de" + "es/latest.md": "https://tutorial.beeware.org/es" + "fr/latest.md": "https://tutorial.beeware.org/fr" + "it/latest.md": "https://tutorial.beeware.org/it" + "pt/latest.md": "https://tutorial.beeware.org/pt" + "zh-cn/latest.md": "https://tutorial.beeware.org/zh_CN" + "zh-tw/latest.md": "https://tutorial.beeware.org/zh_TW" diff --git a/docs/en/index.md b/docs/en/index.md index 0f4beeb5..f3d0b03f 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -8,7 +8,7 @@ Welcome to BeeWare! In this tutorial, we're going to build a graphical user inte /// admonition | Translations are available -If you're not comfortable with English, translations of this tutorial are available in [Deutsch](https://tutorial.beeware.org/de), [Español](https://tutorial.beeware.org/es), [Français](https://tutorial.beeware.org/fr), [Italiano](https://tutorial.beeware.org/it), [Português](https://tutorial.beeware.org/pt), [中文(简体)](https://tutorial.beeware.org/zh-cn), and [中文(繁體)](https://tutorial.beeware.org/zh-tw). +If you're not comfortable with English, translations of this tutorial are available in [Deutsch](https://tutorial.beeware.org/de), [Español](https://tutorial.beeware.org/es), [Français](https://tutorial.beeware.org/fr), [Italiano](https://tutorial.beeware.org/it), [Português](https://tutorial.beeware.org/pt), [中文(简体)](https://tutorial.beeware.org/zh_CN), and [中文(繁體)](https://tutorial.beeware.org/zh_TW). /// diff --git a/pyproject.toml b/pyproject.toml index 98651cb1..b5ae0bee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,10 @@ pre-commit = [ "pre-commit == 4.5.1", ] +redirects = [ + "mkdocs-redirects == 1.2.2", +] + tox-uv = [ "tox-uv == 1.29.0", ] @@ -24,6 +28,8 @@ translate = [ docs = [ "beeware-docs-tools @ git+https://github.com/beeware/beeware-docs-tools", + # "beeware-docs-tools @ file://../beeware-docs-tools", + {include-group = "redirects"}, ] [tool.rumdl] diff --git a/tox.ini b/tox.ini index 6d4f36a0..1286840b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = docs-lint,docs-all [docs] docs_dir = {tox_root}{/}docs{/}en -[testenv:docs{,-lint,-translate,-all,-live,-en,-de,-es,-fr,-it,-pt,-zh-cn,-zh-tw}] +[testenv:docs{,-translate,-lint,-en,-de,-es,-fr,-it,-pt,-zh_CN,-zh_TW,-all,-serve,-live}] # Docs are always built on Python 3.13. See also the RTD config. base_python = py313 skip_install = true @@ -12,7 +12,7 @@ passenv = DEEPL_API_KEY dependency_groups = docs commands: - !lint-!all-!translate-!live-!en-!de-!es-!fr-!it-!pt-!zh-cn-!zh-tw : build_md_translations {posargs} en + !translate-!lint-!en-!de-!es-!fr-!it-!pt-!zh_CN-!zh_TW-!all-!live : build_md_translations {posargs} en translate : build_pot_translations translate : build_po_translations de es fr it pt zh_CN zh_TW translate : update_machine_translations --soft-fail de es fr it pt zh_CN zh_TW @@ -24,8 +24,8 @@ commands: fr : build_md_translations {posargs} fr it : build_md_translations {posargs} it pt : build_md_translations {posargs} pt - zh-cn : build_md_translations {posargs} zh_CN - zh-tw : build_md_translations {posargs} zh_TW + zh_CN : build_md_translations {posargs} zh_CN + zh_TW : build_md_translations {posargs} zh_TW all : build_md_translations {posargs} en de es fr it pt zh_CN zh_TW serve : python -m http.server -d _build/html 8041 live : live_serve_en {posargs} --port=8041