Inline partials and blocks worked as-is.

master
Tom Alexander 4 years ago
parent 250d428464
commit c8de395038
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -338,6 +338,30 @@ impl<'a> DustRenderer<'a> {
return Ok(rendered_content);
}
}
DustTag::DTInlinePartial(_named_block) => {
// Inline partials are blank during rendering (they get injected into blocks)
return Ok("".to_owned());
}
DustTag::DTBlock(named_block) => {
let new_breadcrumbs = self.new_breadcrumbs_partial(
breadcrumbs,
blocks.breadcrumbs,
None,
&named_block.explicit_context,
);
return match blocks.blocks.get_block(named_block.path.keys[0]) {
None => self.render_maybe_body(
&named_block.contents,
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
blocks,
),
Some(inline_partial) => self.render_maybe_body(
inline_partial,
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
blocks,
),
};
}
_ => panic!("Unsupported tag"),
}
Ok("".to_owned())

Loading…
Cancel
Save