diff --git a/hyde/ext/plugins/auto_extend.py b/hyde/ext/plugins/auto_extend.py index e9a7564..878baa8 100644 --- a/hyde/ext/plugins/auto_extend.py +++ b/hyde/ext/plugins/auto_extend.py @@ -23,6 +23,7 @@ class AutoExtendPlugin(Plugin): if not resource.uses_template: return text + layout = None block = None try: @@ -36,6 +37,8 @@ class AutoExtendPlugin(Plugin): pass if layout: + self.logger.debug("Autoextending %s with %s" % ( + resource.relative_path, layout)) extends_pattern = self.template.patterns['extends'] if not re.search(extends_pattern, text): diff --git a/hyde/ext/plugins/meta.py b/hyde/ext/plugins/meta.py index ba151de..d939c14 100644 --- a/hyde/ext/plugins/meta.py +++ b/hyde/ext/plugins/meta.py @@ -78,7 +78,7 @@ class MetaPlugin(Plugin): """ self.logger.info("Trying to load metadata from resource [%s]" % resource) yaml_finder = re.compile( - r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n?", + r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n*", re.MULTILINE) match = re.match(yaml_finder, text) if not match: @@ -97,7 +97,7 @@ class MetaPlugin(Plugin): self.__update_standard_attributes__(resource) self.logger.info("Successfully loaded metadata from resource [%s]" % resource) - return text + return text or ' ' def __update_standard_attributes__(self, obj): """ diff --git a/hyde/ext/templates/jinja.py b/hyde/ext/templates/jinja.py index 13d8c2c..cc4320c 100644 --- a/hyde/ext/templates/jinja.py +++ b/hyde/ext/templates/jinja.py @@ -581,8 +581,15 @@ class Jinja2Template(Template): """ Renders the given resource using the context """ - template = self.env.get_template(resource.relative_path) - return template.render(context) + try: + template = self.env.get_template(resource.relative_path) + out = template.render(context) + except: + out = "" + logger.debug(self.env.loader.get_source( + self.env, resource.relative_path)) + raise + return out def render(self, text, context): """