diff --git a/hyde/ext/templates/jinja.py b/hyde/ext/templates/jinja.py index caeac01..ceb7498 100644 --- a/hyde/ext/templates/jinja.py +++ b/hyde/ext/templates/jinja.py @@ -45,9 +45,11 @@ class Jinja2Template(Template): str(config.media_root_path), str(config.layout_root_path), ]) - self.env = Environment(loader=loader, undefined=LoyalUndefined) - self.env.globals['media_url'] = media_url - self.env.globals['content_url'] = content_url + else: + loader = FileSystemLoader(str(self.sitepath)) + self.env = Environment(loader=loader, undefined=LoyalUndefined) + self.env.globals['media_url'] = media_url + self.env.globals['content_url'] = content_url def render(self, text, context): """ diff --git a/hyde/generator.py b/hyde/generator.py new file mode 100644 index 0000000..bacee29 --- /dev/null +++ b/hyde/generator.py @@ -0,0 +1,34 @@ +""" +The generator class and related utility functions. +""" + +class Generator(object): + """ + Generates output from a node or resource. + """ + + def __init__(self, site): + super(Generator, self).__init__() + self.site = site + + def generate_all(self): + """ + Generates the entire website + """ + pass + + def generate_node(self, node=None): + """ + Generates a single node. If node is non-existent or empty + generates the entire site. + """ + pass + + def generate_resource(self, resource=None): + """ + Generates a single resource. If resource is non-existent or empty + generats the entire website. + """ + pass + + diff --git a/hyde/tests/sites/test_jinja/layout/base.html b/hyde/tests/sites/test_jinja/layout/base.html index afce0f3..62bafb8 100644 --- a/hyde/tests/sites/test_jinja/layout/base.html +++ b/hyde/tests/sites/test_jinja/layout/base.html @@ -5,14 +5,14 @@
{% block starthead %}{% endblock starthead %} - +