From 6e9b771abff8f4a8ef425e887292edb04141917d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 19 Dec 2020 19:54:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20docs=20overrides=20directo?= =?UTF-8?q?ry=20for=20translations=20(#2541)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🙈 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) --- 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 | 0 scripts/docs.py | 7 ++++++- 12 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/es/overrides/.gitignore create mode 100644 docs/fr/overrides/.gitignore create mode 100644 docs/it/overrides/.gitignore create mode 100644 docs/ja/overrides/.gitignore create mode 100644 docs/ko/overrides/.gitignore create mode 100644 docs/pt/overrides/.gitignore create mode 100644 docs/ru/overrides/.gitignore create mode 100644 docs/sq/overrides/.gitignore create mode 100644 docs/tr/overrides/.gitignore create mode 100644 docs/uk/overrides/.gitignore create mode 100644 docs/zh/overrides/.gitignore diff --git a/docs/es/overrides/.gitignore b/docs/es/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/fr/overrides/.gitignore b/docs/fr/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/it/overrides/.gitignore b/docs/it/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/ja/overrides/.gitignore b/docs/ja/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/ko/overrides/.gitignore b/docs/ko/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/pt/overrides/.gitignore b/docs/pt/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/ru/overrides/.gitignore b/docs/ru/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/sq/overrides/.gitignore b/docs/sq/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tr/overrides/.gitignore b/docs/tr/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/uk/overrides/.gitignore b/docs/uk/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/docs/zh/overrides/.gitignore b/docs/zh/overrides/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/docs.py b/scripts/docs.py index 00b6c8318..b8d162f63 100644 --- a/scripts/docs.py +++ b/scripts/docs.py @@ -136,7 +136,12 @@ def build_lang( shutil.rmtree(build_lang_path, ignore_errors=True) shutil.copytree(lang_path, build_lang_path) 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: dict = mkdocs.utils.yaml_load(en_config_path.read_text(encoding="utf-8")) nav = en_config["nav"]