Skip to content

Commit

Permalink
fix #2166
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Dec 18, 2015
1 parent 4195681 commit fc99b38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,7 @@ New in master
Features
--------

* Added cache for Jinja templates (Issue #2166)
* Use Jupyter instead of IPython shims (Issue #1938)
* Automatically open gallery images colorbox based on URL fragment (Issue #2146)

Expand Down
5 changes: 4 additions & 1 deletion nikola/plugins/template/jinja.py
Expand Up @@ -52,7 +52,10 @@ def __init__(self):
"""Initialize Jinja2 environment with extended set of filters."""
if jinja2 is None:
return
self.lookup = jinja2.Environment()
# Not ideal because it's not using our cache structure
# but we don't have that folder at init time
cache = jinja2.FileSystemBytecodeCache()
self.lookup = jinja2.Environment(bytecode_cache=cache)
self.lookup.trim_blocks = True
self.lookup.lstrip_blocks = True
self.lookup.filters['tojson'] = json.dumps
Expand Down

0 comments on commit fc99b38

Please sign in to comment.