Skip to content

Commit

Permalink
Need to move part of global context setup to after plugin loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Mar 12, 2017
1 parent 41659ae commit bb0639f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nikola/nikola.py
Expand Up @@ -1117,6 +1117,12 @@ def init_plugins(self, commands_only=False, load_all=False):
self.plugin_manager._candidates = self._filter_duplicate_plugins(to_add)
self.plugin_manager.loadPlugins()


# IPython theme configuration. If a website has ipynb enabled in post_pages
# we should enable the IPython CSS (leaving that up to the theme itself).
if 'needs_ipython_css' not in self._GLOBAL_CONTEXT:
self._GLOBAL_CONTEXT['needs_ipython_css'] = 'ipynb' in self.config['COMPILERS']

self._activate_plugins_of_category("Taxonomy")
self.taxonomy_plugins = {}
for taxonomy in [p.plugin_object for p in self.plugin_manager.getPluginsOfCategory('Taxonomy')]:
Expand Down Expand Up @@ -1258,11 +1264,6 @@ def _set_global_context_from_config(self):
self._GLOBAL_CONTEXT['sort_posts'] = utils.sort_posts
self._GLOBAL_CONTEXT['meta_generator_tag'] = self.config.get('META_GENERATOR_TAG')

# IPython theme configuration. If a website has ipynb enabled in post_pages
# we should enable the IPython CSS (leaving that up to the theme itself).

self._GLOBAL_CONTEXT['needs_ipython_css'] = 'ipynb' in self.config['COMPILERS']

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

def _set_global_context_from_data(self):
Expand Down

0 comments on commit bb0639f

Please sign in to comment.