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 26, 2017
1 parent 7d60272 commit 2120fa5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nikola/nikola.py
Expand Up @@ -1111,13 +1111,18 @@ def init_plugins(self, commands_only=False, load_all=False):
to_add.append(p)
for name, p in self.disabled_compilers.items():
utils.LOGGER.debug('Not loading unneeded compiler {}', p[-1].name)
for name, plugins in self.disabled_compiler_extensions.items():
for _, plugins in self.disabled_compiler_extensions.items():
for p in plugins:
utils.LOGGER.debug('Not loading compiler extension {}', p[-1].name)
if to_add:
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 @@ -1259,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 2120fa5

Please sign in to comment.