🐛 Fix docs overrides directory for translations (#2541)

* 🙈 Add .gitignore files to keep overrides directories for translations to fix serving live locally during translations

* ♻️ Refactor docs scripts to handle language overrides (newsletter notification)
This commit is contained in:
Sebastián Ramírez 2020-12-19 19:54:54 +01:00 committed by GitHub
parent 4a93562a3d
commit 6e9b771abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 6 additions and 1 deletions

0
docs/es/overrides/.gitignore vendored Normal file
View File

0
docs/fr/overrides/.gitignore vendored Normal file
View File

0
docs/it/overrides/.gitignore vendored Normal file
View File

0
docs/ja/overrides/.gitignore vendored Normal file
View File

0
docs/ko/overrides/.gitignore vendored Normal file
View File

0
docs/pt/overrides/.gitignore vendored Normal file
View File

0
docs/ru/overrides/.gitignore vendored Normal file
View File

0
docs/sq/overrides/.gitignore vendored Normal file
View File

0
docs/tr/overrides/.gitignore vendored Normal file
View File

0
docs/uk/overrides/.gitignore vendored Normal file
View File

0
docs/zh/overrides/.gitignore vendored Normal file
View File

View File

@ -136,7 +136,12 @@ def build_lang(
shutil.rmtree(build_lang_path, ignore_errors=True) shutil.rmtree(build_lang_path, ignore_errors=True)
shutil.copytree(lang_path, build_lang_path) shutil.copytree(lang_path, build_lang_path)
shutil.copytree(en_docs_path / "data", build_lang_path / "data") shutil.copytree(en_docs_path / "data", build_lang_path / "data")
shutil.copytree(en_docs_path / "overrides", build_lang_path / "overrides") overrides_src = en_docs_path / "overrides"
overrides_dest = build_lang_path / "overrides"
for path in overrides_src.iterdir():
dest_path = overrides_dest / path.name
if not dest_path.exists():
shutil.copy(path, dest_path)
en_config_path: Path = en_lang_path / mkdocs_name en_config_path: Path = en_lang_path / mkdocs_name
en_config: dict = mkdocs.utils.yaml_load(en_config_path.read_text(encoding="utf-8")) en_config: dict = mkdocs.utils.yaml_load(en_config_path.read_text(encoding="utf-8"))
nav = en_config["nav"] nav = en_config["nav"]