This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new d40c02e1ce7 GH-46956: [Docs][CI] Enable version switcher in local and
PR preview build (#46957)
d40c02e1ce7 is described below
commit d40c02e1ce75e184d27e763244bd917ef27492ab
Author: Alenka Frim <[email protected]>
AuthorDate: Sun May 24 00:02:38 2026 +0200
GH-46956: [Docs][CI] Enable version switcher in local and PR preview build
(#46957)
### Rationale for this change
Currently, the version switcher is not functional in local builds or in PR
preview docs via crossbow, since it relies on the versions.json file from the
arrow site.
This makes it difficult to test changes to the switcher configuration or
verify that nothing breaks with new theme updates.
### What changes are included in this PR?
The version switcher is enabled in a dev setup by:
- Using online versions.json file when building locally or in PR preview
- Falling back to the arrow-site JSON otherwise
### Are these changes tested?
Yes, preview-docs build.
### Are there any user-facing changes?
No, only local testing is simplified.
* GitHub Issue: #46956
Authored-by: AlenkaF <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
docs/source/conf.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 8b7798800a1..bd143887a04 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -331,10 +331,12 @@ html_theme = 'pydata_sphinx_theme'
switcher_version = version
if ".dev" in version:
switcher_version = "dev/"
+ json_url = "https://arrow.apache.org/docs/_static/versions.json"
else:
# If we are not building dev version of the docs, we are building
# docs for the stable version
switcher_version = ""
+ json_url = "/docs/_static/versions.json"
html_theme_options = {
"show_toc_level": 2,
@@ -365,7 +367,7 @@ html_theme_options = {
],
"show_version_warning_banner": True,
"switcher": {
- "json_url": "/docs/_static/versions.json",
+ "json_url": json_url,
"version_match": switcher_version,
},
}