Skip to content

Commit 22755b4

Browse files
authored
Confgure "suggest a change" links properly (apache#49702)
After moving the docs, the links to "Suggest a change" for airflow, docker-compose and helm-chart lead to a wrong URL. This PR fixes it. We also do not use analytics any more so configuration for it is not needed any more. Fixes: apache#49694
1 parent 1cd8614 commit 22755b4

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

airflow-core/docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
SYSTEM_TESTS_DIR: pathlib.Path | None
6868
SYSTEM_TESTS_DIR = AIRFLOW_REPO_ROOT_PATH / "airflow-core" / "tests" / "system" / "core"
6969

70-
conf_py_path = f"/docs/{PACKAGE_NAME}/"
71-
7270
os.environ["AIRFLOW_PACKAGE_NAME"] = PACKAGE_NAME
7371

7472
# Hack to allow changing for piece of the code to behave differently while
@@ -238,6 +236,7 @@ def add_airflow_core_exclude_patterns_to_sphinx(exclude_patterns: list[str]):
238236
# html theme options
239237
html_theme_options: dict[str, Any] = get_html_theme_options()
240238

239+
conf_py_path = "/airflow-core/docs/"
241240
# A dictionary of values to pass into the template engine's context for all pages.
242241
html_context = get_html_context(conf_py_path)
243242

chart/docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
CHART_ROOT_PATH = AIRFLOW_REPO_ROOT_PATH / "chart"
6565
CHART_DOC_PATH = CHART_ROOT_PATH / "docs"
6666
CHART_STATIC_PATH = CHART_DOC_PATH / "static"
67-
conf_py_path = f"/docs/{PACKAGE_NAME}/"
68-
6967
os.environ["AIRFLOW_PACKAGE_NAME"] = PACKAGE_NAME
7068

7169
CHART_YAML_FILE_PATH = CHART_ROOT_PATH / "Chart.yaml"
@@ -134,6 +132,10 @@
134132

135133
html_title = f"{PACKAGE_NAME} Documentation"
136134

135+
conf_py_path = "/chart/docs/"
136+
# A dictionary of values to pass into the template engine's context for all pages.
137+
html_context = get_html_context(conf_py_path)
138+
137139
# A shorter title for the navigation bar. Default is the same as html_title.
138140
html_short_title = ""
139141

devel-common/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ dependencies = [
7474
"rich-click>=1.7.1",
7575
"click>=8.1.8",
7676
"docutils>=0.21",
77-
"sphinx-airflow-theme>=0.1.0",
77+
"sphinx-airflow-theme>=0.2.2",
7878
"sphinx-argparse>=0.4.0",
7979
"sphinx-autoapi>=3",
8080
"sphinx-autobuild>=2024.10.2",

devel-common/src/docs/provider_conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
BASE_PROVIDER_SRC_PATH = PROVIDER_PATH / "src" / "airflow"
8181
PACKAGE_VERSION = CURRENT_PROVIDER["versions"][0]
8282
SYSTEM_TESTS_DIR = PROVIDER_PATH / "tests" / "system"
83-
conf_py_path = f"/providers/{PACKAGE_ID.replace('.', '/')}/docs/"
8483

8584
# Adds to environment variables for easy access from other plugins like airflow_intersphinx.
8685
os.environ["AIRFLOW_PACKAGE_NAME"] = PACKAGE_NAME
@@ -221,6 +220,8 @@
221220

222221
html_theme_options: dict[str, Any] = get_html_theme_options()
223222

223+
224+
conf_py_path = f"/providers/{PACKAGE_ID.replace('.', '/')}/docs/"
224225
# A dictionary of values to pass into the template engine's context for all pages.
225226
html_context = get_html_context(conf_py_path)
226227

devel-common/src/docs/utils/conf_constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ def get_html_theme_options():
150150

151151
def get_html_context(conf_py_path: str):
152152
return {
153-
# Google Analytics ID.
154-
# For more information look at:
155-
# https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html#L222-L232
156-
"theme_analytics_id": "UA-140539454-1",
157153
# Variables used to build a button for editing the source code
158154
#
159155
# The path is created according to the following template:

docker-stack-docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262

6363
PACKAGE_VERSION: str = "stable"
6464

65-
conf_py_path = f"/docs/{PACKAGE_NAME}/"
66-
6765
# Adds to environment variables for easy access from other plugins like airflow_intersphinx.
6866
os.environ["AIRFLOW_PACKAGE_NAME"] = PACKAGE_NAME
6967

@@ -155,6 +153,7 @@
155153

156154
html_theme_options: dict[str, Any] = get_html_theme_options()
157155

156+
conf_py_path = "/docker-stack-docs/"
158157
# A dictionary of values to pass into the template engine's context for all pages.
159158
html_context = get_html_context(conf_py_path)
160159

providers-summary-docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
PACKAGE_NAME = "apache-airflow-providers"
6161
PROVIDERS_SUMMARY_DOCS_PATH = AIRFLOW_REPO_ROOT_PATH / "providers-summary-docs"
6262

63-
conf_py_path = f"/docs/{PACKAGE_NAME}/"
64-
6563
os.environ["AIRFLOW_PACKAGE_NAME"] = PACKAGE_NAME
6664

6765
PACKAGE_VERSION = "stable"
@@ -166,6 +164,7 @@
166164

167165
html_theme_options: dict[str, Any] = get_html_theme_options()
168166

167+
conf_py_path = "/providers-summary-docs/"
169168
# A dictionary of values to pass into the template engine's context for all pages.
170169
html_context = get_html_context(conf_py_path)
171170

0 commit comments

Comments
 (0)