1
0
Fork 0
forked from github/pelican

Modified Generator Base Class in order to pass custom Jinja filters in

settings.py
This commit is contained in:
Alessandro Martin 2011-04-12 02:17:42 +08:00 committed by Alexis Metaireau
commit c421956cd9

View file

@ -35,6 +35,10 @@ class Generator(object):
loader=FileSystemLoader(self._templates_path),
extensions=self.settings.get('JINJA_EXTENSIONS', []),
)
# get custom Jinja filters from user settings
custom_filters = self.settings.get('JINJA_FILTERS', {})
self._env.filters.update(custom_filters)
def get_template(self, name):
"""Return the template by name.