diff piecrust/templating/jinjaengine.py @ 849:8f8bbb2e70e1

templating: Template engines can now load extensions directly from plugins.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 27 Apr 2017 20:55:07 -0700
parents 0da1207472d3
children 2c7e57d80bba
line wrap: on
line diff
--- a/piecrust/templating/jinjaengine.py	Thu Apr 27 20:54:29 2017 -0700
+++ b/piecrust/templating/jinjaengine.py	Thu Apr 27 20:55:07 2017 -0700
@@ -127,6 +127,8 @@
             if '.' not in n:
                 n = 'jinja2.ext.' + n
             extensions.append(n)
+        for je in self.app.plugin_loader.getTemplateEngineExtensions('jinja'):
+            extensions.append(je)
 
         # Create the Jinja environment.
         logger.debug("Creating Jinja environment with folders: %s" %