kou commented on code in PR #14839:
URL: https://github.com/apache/arrow/pull/14839#discussion_r1043850092
##########
docs/source/_templates/layout.html:
##########
@@ -26,3 +26,9 @@
{# Silence the navbar #}
{% block docs_navbar %}
{% endblock %}
+
+{# Add version warnings #}
+{% block footer %}
+ {{ super() }}
+ <script type="text/javascript" src="/docs/versionwarning.js"></script>
Review Comment:
Can we use Sphinx variable for it something like the following?
```diff
diff --git a/ci/scripts/python_build.sh b/ci/scripts/python_build.sh
index cfac68bd6e..d02d654205 100755
--- a/ci/scripts/python_build.sh
+++ b/ci/scripts/python_build.sh
@@ -83,5 +83,10 @@ popd
if [ "${BUILD_DOCS_PYTHON}" == "ON" ]; then
ncpus=$(python -c "import os; print(os.cpu_count())")
- sphinx-build -b html -j ${ncpus} ${arrow_dir}/docs/source
${build_dir}/docs
+ sphinx-build \
+ -b html \
+ -j ${ncpus} \
+ -D
version_warning_js=://arrow.apache.org/docs/dev/_static/version_warning.js \
+ ${arrow_dir}/docs/source \
+ ${build_dir}/docs
fi
diff --git a/docs/source/_templates/layout.html
b/docs/source/_templates/layout.html
index 50511b1416..fd5186fdac 100644
--- a/docs/source/_templates/layout.html
+++ b/docs/source/_templates/layout.html
@@ -30,5 +30,5 @@
{# Add version warnings #}
{% block footer %}
{{ super() }}
- <script type="text/javascript" src="/docs/versionwarning.js"></script>
+ <script type="text/javascript" src="{{ pathto(version_warning_js, 1)
}}"></script>
{% endblock %}
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2c3686df87..92b7f2cbf4 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -148,6 +148,9 @@ autosummary_generate = True
# The master toctree document.
master_doc = 'index'
+# Path to version_warning.js.
+version_warning_js = "_static/version_warning.js"
+
# General information about the project.
project = u'Apache Arrow'
copyright = f'2016-{datetime.datetime.now().year} Apache Software
Foundation'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]