File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33{% block relbar1 %}
44
55
6- <!-- for main branch only, do not backport this -->
76{%- if branch == 'main' %}
7+ <!-- add a ribbon to show these docs are the main branch -->
88< h4 class ="ribbon "> DOCS PREVIEW</ h4 >
99{%- endif %}
1010
Original file line number Diff line number Diff line change 1111# All configuration values have a default; values that are commented out
1212# serve to show the default.
1313
14- import sys , os , shutil
14+ import sys , os
1515import inspect
1616from unittest .mock import MagicMock #py3 only
1717
@@ -243,8 +243,8 @@ def __getattr__(cls, name):
243243html_theme = "classic"
244244
245245# Add the branch name as a variable that can be used in templates
246- # this can be set as a sphinx-build option using `-A BRANCH=main`
247- html_context = {'branch' : release }
246+ # Defaults to 'local'if GIT_BRANCH isn't set (e.g. local builds)
247+ html_context = {'branch' : os . environ . get ( 'GIT_BRANCH' , 'local' ) }
248248
249249# linkcheck options
250250# -----------------
You can’t perform that action at this time.
0 commit comments