Browse Source

Honour template setting in configuration

main
Jordi Llonch 11 years ago
parent
commit
03a1665bb6
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      hyde/template.py

+ 5
- 4
hyde/template.py View File

@@ -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

Loading…
Cancel
Save