Mercurial > piecrust2
comparison piecrust/templating/jinjaengine.py @ 184:27d623a241c6
render: Don't always use a `.html` extension for layouts.
The rendering code now only looks for the extensions explicitely specified
by the template engine. To compensate, the Jinja engine specifies `.html`
as its last supported extension.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 04 Jan 2015 14:58:40 -0800 |
parents | 28444014ce7d |
children | 1163bd034dc5 |
comparison
equal
deleted
inserted
replaced
183:fff195335d0a | 184:27d623a241c6 |
---|---|
25 | 25 |
26 | 26 |
27 class JinjaTemplateEngine(TemplateEngine): | 27 class JinjaTemplateEngine(TemplateEngine): |
28 # Name `twig` is for backwards compatibility with PieCrust 1.x. | 28 # Name `twig` is for backwards compatibility with PieCrust 1.x. |
29 ENGINE_NAMES = ['jinja', 'jinja2', 'twig'] | 29 ENGINE_NAMES = ['jinja', 'jinja2', 'twig'] |
30 EXTENSIONS = ['jinja', 'jinja2', 'twig'] | 30 EXTENSIONS = ['jinja', 'jinja2', 'twig', 'html'] |
31 | 31 |
32 def __init__(self): | 32 def __init__(self): |
33 self.env = None | 33 self.env = None |
34 | 34 |
35 def renderString(self, txt, data, filename=None): | 35 def renderString(self, txt, data, filename=None): |