@@ -23,6 +23,7 @@ class AutoExtendPlugin(Plugin): | |||||
if not resource.uses_template: | if not resource.uses_template: | ||||
return text | return text | ||||
layout = None | layout = None | ||||
block = None | block = None | ||||
try: | try: | ||||
@@ -36,6 +37,8 @@ class AutoExtendPlugin(Plugin): | |||||
pass | pass | ||||
if layout: | if layout: | ||||
self.logger.debug("Autoextending %s with %s" % ( | |||||
resource.relative_path, layout)) | |||||
extends_pattern = self.template.patterns['extends'] | extends_pattern = self.template.patterns['extends'] | ||||
if not re.search(extends_pattern, text): | if not re.search(extends_pattern, text): | ||||
@@ -78,7 +78,7 @@ class MetaPlugin(Plugin): | |||||
""" | """ | ||||
self.logger.info("Trying to load metadata from resource [%s]" % resource) | self.logger.info("Trying to load metadata from resource [%s]" % resource) | ||||
yaml_finder = re.compile( | yaml_finder = re.compile( | ||||
r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n?", | |||||
r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n*", | |||||
re.MULTILINE) | re.MULTILINE) | ||||
match = re.match(yaml_finder, text) | match = re.match(yaml_finder, text) | ||||
if not match: | if not match: | ||||
@@ -97,7 +97,7 @@ class MetaPlugin(Plugin): | |||||
self.__update_standard_attributes__(resource) | self.__update_standard_attributes__(resource) | ||||
self.logger.info("Successfully loaded metadata from resource [%s]" | self.logger.info("Successfully loaded metadata from resource [%s]" | ||||
% resource) | % resource) | ||||
return text | |||||
return text or ' ' | |||||
def __update_standard_attributes__(self, obj): | def __update_standard_attributes__(self, obj): | ||||
""" | """ | ||||
@@ -581,8 +581,15 @@ class Jinja2Template(Template): | |||||
""" | """ | ||||
Renders the given resource using the context | 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): | def render(self, text, context): | ||||
""" | """ | ||||