Skip to content

Commit b0aa489

Browse files
committed
doc_builder: make it possible to use a different default theme
1 parent dd8a2d1 commit b0aa489

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

readthedocs/doc_builder/backends/sphinx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def get_config_params(self):
9898
downloads = api.version(self.version.pk).get()['downloads']
9999

100100
data = {
101+
'html_theme': 'sphinx_rtd_theme',
102+
'html_theme_import': 'sphinx_rtd_theme',
101103
'current_version': self.version.verbose_name,
102104
'project': self.project,
103105
'version': self.version,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ using_rtd_theme = (
4545
html_theme in ['default'] and
4646
# Allow people to bail with a hack of having an html_style
4747
not 'html_style' in globals()
48-
) or 'html_theme' in globals()
48+
) or 'html_theme' not in globals()
4949
)
5050
if using_rtd_theme:
51-
import sphinx_rtd_theme
52-
html_theme = 'sphinx_rtd_theme'
51+
theme = __import__('{{ html_theme_import }}')
52+
html_theme = '{{ html_theme }}'
5353
html_style = None
5454
html_theme_options = {}
5555
if 'html_theme_path' in globals():
56-
html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
56+
html_theme_path.append(theme.get_html_theme_path())
5757
else:
58-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
58+
html_theme_path = [theme.get_html_theme_path()]
5959

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

0 commit comments

Comments
 (0)