Skip to content

Commit dd8a2d1

Browse files
committed
doc_builder: remove duplication around html_theme
1 parent 2f60b93 commit dd8a2d1

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,15 @@ if os.path.exists('_static'):
3939
html_static_path.append('{{ static_path }}')
4040

4141
# Add RTD Theme only if they aren't overriding it already
42-
using_rtd_theme = False
43-
if 'html_theme' in globals():
44-
if html_theme in ['default']:
42+
using_rtd_theme = (
43+
(
44+
'html_theme' in globals() and
45+
html_theme in ['default'] and
4546
# Allow people to bail with a hack of having an html_style
46-
if not 'html_style' in globals():
47-
import sphinx_rtd_theme
48-
html_theme = 'sphinx_rtd_theme'
49-
html_style = None
50-
html_theme_options = {}
51-
if 'html_theme_path' in globals():
52-
html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
53-
else:
54-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
55-
56-
using_rtd_theme = True
57-
else:
47+
not 'html_style' in globals()
48+
) or 'html_theme' in globals()
49+
)
50+
if using_rtd_theme:
5851
import sphinx_rtd_theme
5952
html_theme = 'sphinx_rtd_theme'
6053
html_style = None
@@ -63,7 +56,6 @@ else:
6356
html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
6457
else:
6558
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
66-
using_rtd_theme = True
6759

6860
if globals().get('websupport2_base_url', False):
6961
websupport2_base_url = '{{ api_host }}/websupport'

0 commit comments

Comments
 (0)