Skip to content

Commit 3ff92f9

Browse files
committed
Add back ribbon
1 parent 3e907bf commit 3ff92f9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
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

conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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
1515
import inspect
1616
from unittest.mock import MagicMock #py3 only
1717

@@ -243,8 +243,8 @@ def __getattr__(cls, name):
243243
html_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
# -----------------

0 commit comments

Comments
 (0)