From f7ed3b3a346b40f0d4e7c844c27afce9eefec54e Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 2 Jul 2026 16:51:23 +0200 Subject: [PATCH] docs: derive current_version from DOCS_DISPLAY_VERSION too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix set only display_version from DOCS_DISPLAY_VERSION, but the version switcher (current_version and generateVersionsDocs) still relied on _stable_ver, which is empty in the consolidated deploy — so the switcher showed "latest" and highlighted the wrong version. Let _stable_ver honour DOCS_DISPLAY_VERSION so all three resolve to the built version. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv --- conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 416dce0ba0a..ce18ac7324e 100644 --- a/conf.py +++ b/conf.py @@ -66,12 +66,15 @@ import re as _re # Detect stable branch version for display purposes. +# In the consolidated deploy DOCS_DISPLAY_VERSION carries the built version (the +# reserved GITHUB_* refs cannot be set per matrix leg). # For PRs: GITHUB_BASE_REF is the target branch (e.g. 'stable32'). # For direct pushes: GITHUB_REF is 'refs/heads/stable32'. _base = os.environ.get('GITHUB_BASE_REF', '') _ref = os.environ.get('GITHUB_REF', '') _stable_ver = ( - _re.match(r'^stable(\d+)$', _base) + _re.match(r'^(\d+)$', os.environ.get('DOCS_DISPLAY_VERSION', '')) + or _re.match(r'^stable(\d+)$', _base) or _re.match(r'^refs/heads/stable(\d+)$', _ref) ) display_version = os.environ.get('DOCS_DISPLAY_VERSION') or (