From 03a1665bb6449e70e25e119aaec4286642fd60db Mon Sep 17 00:00:00 2001 From: Jordi Llonch Date: Fri, 25 Oct 2013 15:47:37 +1100 Subject: [PATCH] Honour template setting in configuration --- hyde/template.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hyde/template.py b/hyde/template.py index 85841b9..ae02d4a 100644 --- a/hyde/template.py +++ b/hyde/template.py @@ -7,8 +7,9 @@ from hyde.exceptions import HydeException import abc -from commando.util import getLoggerWithNullHandler +from commando.util import getLoggerWithNullHandler, load_python_object +DEFAULT_TEMPLATE = 'hyde.ext.templates.jinja.Jinja2Template' class HtmlWrap(object): """ @@ -159,7 +160,7 @@ class Template(object): """ Reads the configuration to find the appropriate template. """ - # TODO: Find the appropriate template environment - from hyde.ext.templates.jinja import Jinja2Template - template = Jinja2Template(site.sitepath) + template_object = site.config.get('template', DEFAULT_TEMPLATE) + template_cls = load_python_object(template_object) + template = template_cls(site.sitepath) return template