Browse Source

🐛 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)
pull/1885/merge
Sebastián Ramírez 4 years ago
committed by GitHub
parent
commit
6e9b771abf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      docs/es/overrides/.gitignore
  2. 0
      docs/fr/overrides/.gitignore
  3. 0
      docs/it/overrides/.gitignore
  4. 0
      docs/ja/overrides/.gitignore
  5. 0
      docs/ko/overrides/.gitignore
  6. 0
      docs/pt/overrides/.gitignore
  7. 0
      docs/ru/overrides/.gitignore
  8. 0
      docs/sq/overrides/.gitignore
  9. 0
      docs/tr/overrides/.gitignore
  10. 0
      docs/uk/overrides/.gitignore
  11. 0
      docs/zh/overrides/.gitignore
  12. 7
      scripts/docs.py

0
docs/es/overrides/.gitignore

0
docs/fr/overrides/.gitignore

0
docs/it/overrides/.gitignore

0
docs/ja/overrides/.gitignore

0
docs/ko/overrides/.gitignore

0
docs/pt/overrides/.gitignore

0
docs/ru/overrides/.gitignore

0
docs/sq/overrides/.gitignore

0
docs/tr/overrides/.gitignore

0
docs/uk/overrides/.gitignore

0
docs/zh/overrides/.gitignore

7
scripts/docs.py

@ -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"]

Loading…
Cancel
Save