diff --git a/components/content/src/page.rs b/components/content/src/page.rs
index f977c464..d2f940d7 100644
--- a/components/content/src/page.rs
+++ b/components/content/src/page.rs
@@ -172,13 +172,14 @@ impl Page {
let res = render_content(
&self.raw_content.replacen("", "", 1),
&context
- )?;
+ ).chain_err(|| format!("Failed to render content of {}", self.file.path.display()))?;
self.content = res.0;
self.toc = res.1;
if self.raw_content.contains("") {
self.summary = Some({
let summary = self.raw_content.splitn(2, "").collect::>()[0];
- render_content(summary, &context)?.0
+ render_content(summary, &context)
+ .chain_err(|| format!("Failed to render content of {}", self.file.path.display()))?.0
})
}
diff --git a/components/content/src/section.rs b/components/content/src/section.rs
index c864318e..550acf76 100644
--- a/components/content/src/section.rs
+++ b/components/content/src/section.rs
@@ -105,7 +105,8 @@ impl Section {
permalinks,
self.meta.insert_anchor_links,
);
- let res = render_content(&self.raw_content, &context)?;
+ let res = render_content(&self.raw_content, &context)
+ .chain_err(|| format!("Failed to render content of {}", self.file.path.display()))?;
self.content = res.0;
self.toc = res.1;
Ok(())