Skip to content

Commit

Permalink
add needs_ipython_css to global context
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 4, 2015
1 parent 1870328 commit c3d5a4e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nikola/nikola.py
Expand Up @@ -796,6 +796,16 @@ def __init__(self, **config):
self._GLOBAL_CONTEXT['hidden_categories'] = self.config.get('HIDDEN_CATEGORIES')
self._GLOBAL_CONTEXT['url_replacer'] = self.url_replacer

# IPython theme configuration. If a website can potentially have ipynb
# posts (as determined by checking POSTS/PAGES against ipynb
# extensions), we should enable the IPython CSS (leaving that up to the
# theme itself).

self._GLOBAL_CONTEXT['needs_ipython_css'] = False
for i in self.config['post_pages']:
if os.path.splitext(i[0])[0] in self.config['COMPILERS'].get('ipynb', []):
self._GLOBAL_CONTEXT['needs_ipython_css'] = True

self._GLOBAL_CONTEXT.update(self.config.get('GLOBAL_CONTEXT', {}))

# Load compiler plugins
Expand Down

0 comments on commit c3d5a4e

Please sign in to comment.