Skip to content
Permalink
Browse files

add needs_ipython_css to global context

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
Kwpolska committed Jun 4, 2015
1 parent 1870328 commit c3d5a4ed1726a55290260556c9607c2b0fac7fdb
Showing with 10 additions and 0 deletions.
  1. +10 −0 nikola/nikola.py
@@ -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

0 comments on commit c3d5a4e

Please sign in to comment.
You can’t perform that action at this time.