This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-0-test by this push:
new f8ba8ea6c2c [v3-0-test] Fix redirects (#54238) (#54251)
f8ba8ea6c2c is described below
commit f8ba8ea6c2ce7d7cbc30582499a992c375715011
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Aug 8 06:25:34 2025 +0200
[v3-0-test] Fix redirects (#54238) (#54251)
* Update redirects
* Update redirects
* Update generate_redirects function to set correct redirects path
(cherry picked from commit dc952f0cf44691b67c51d5de34973886d8025209)
Co-authored-by: GPK <[email protected]>
---
airflow-core/docs/redirects.txt | 4 ++--
devel-common/src/sphinx_exts/redirects.py | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/airflow-core/docs/redirects.txt b/airflow-core/docs/redirects.txt
index fec740e5fa3..582cbe90c15 100644
--- a/airflow-core/docs/redirects.txt
+++ b/airflow-core/docs/redirects.txt
@@ -184,5 +184,5 @@ howto/operator/python.rst
../../apache-airflow-providers-standard/stable/operato
howto/operator/time.rst
../../apache-airflow-providers-standard/stable/sensors/datetime.rst
howto/operator/weekday.rst
../../apache-airflow-providers-standard/stable/operators/datetime.rst#branchdayofweekoperator
-_api/airflow/operators/datetime/index.html
../apache-airflow-providers-standard/stable/_api/airflow/providers/standard/operators/datetime/index.html
-_api/airflow/operators/empty/index.html
../apache-airflow-providers-standard/stable/_api/airflow/providers/standard/operators/empty/index.html
+_api/airflow/operators/datetime/index.html
../../apache-airflow-providers-standard/stable/_api/airflow/providers/standard/operators/datetime/index.html
+_api/airflow/operators/empty/index.html
../../apache-airflow-providers-standard/stable/_api/airflow/providers/standard/operators/empty/index.html
diff --git a/devel-common/src/sphinx_exts/redirects.py
b/devel-common/src/sphinx_exts/redirects.py
index 95e6de21210..f9345c58ba9 100644
--- a/devel-common/src/sphinx_exts/redirects.py
+++ b/devel-common/src/sphinx_exts/redirects.py
@@ -62,7 +62,13 @@ def generate_redirects(app):
to_path_prefix = f"..{os.path.sep}" *
(len(from_path.split(os.path.sep)) - 1)
# The redirect path needs to move back to the root of the
apache-airflow docs directory
# or the root of the docs directory altogether for provider
distributions.
- if "../" and "providers" in to_path:
+ if (
+ from_path.startswith("_api/airflow/")
+ and "_api/airflow/providers" not in from_path
+ and "providers" in to_path
+ ):
+ to_path_prefix = f"..{os.path.sep}" *
(len(from_path.split(os.path.sep)) - 1)
+ elif "../" and "providers" in to_path:
to_path_prefix = f"..{os.path.sep}" *
(len(from_path.split(os.path.sep)))
else:
to_path_prefix = f"..{os.path.sep}" *
(len(from_path.split(os.path.sep)) - 1)