From 3ff92f9c588fa2ae8ddd65fedcb69052f8e9ab8a Mon Sep 17 00:00:00 2001 From: sethg Date: Sat, 13 Jun 2026 00:33:14 +0200 Subject: [PATCH] Add back ribbon --- _templates/layout.html | 2 +- conf.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_templates/layout.html b/_templates/layout.html index 8f360cf4172..ec144f52c32 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -3,8 +3,8 @@ {% block relbar1 %} - {%- if branch == 'main' %} +

DOCS PREVIEW

{%- endif %} diff --git a/conf.py b/conf.py index 3a1b9f30788..b5d60fdf684 100644 --- a/conf.py +++ b/conf.py @@ -11,7 +11,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os, shutil +import sys, os import inspect from unittest.mock import MagicMock #py3 only @@ -243,8 +243,8 @@ def __getattr__(cls, name): html_theme = "classic" # Add the branch name as a variable that can be used in templates -# this can be set as a sphinx-build option using `-A BRANCH=main` -html_context = {'branch': release} +# Defaults to 'local'if GIT_BRANCH isn't set (e.g. local builds) +html_context = {'branch': os.environ.get('GIT_BRANCH', 'local')} # linkcheck options # -----------------