I did it backwards, I needed to use the explicit context from the block, not the inline partial.
This commit is contained in:
@@ -343,27 +343,21 @@ impl<'a> DustRenderer<'a> {
|
||||
return Ok("".to_owned());
|
||||
}
|
||||
DustTag::DTBlock(named_block) => {
|
||||
let new_breadcrumbs = blocks
|
||||
.blocks
|
||||
.get_explicit_context(named_block.name)
|
||||
.map(|explicit_context| {
|
||||
Self::new_breadcrumbs(
|
||||
breadcrumbs,
|
||||
blocks.breadcrumbs,
|
||||
None,
|
||||
explicit_context,
|
||||
None,
|
||||
)
|
||||
})
|
||||
.flatten();
|
||||
let new_breadcrumbs = Self::new_breadcrumbs(
|
||||
breadcrumbs,
|
||||
blocks.breadcrumbs,
|
||||
None,
|
||||
&named_block.explicit_context,
|
||||
None,
|
||||
);
|
||||
return match blocks.blocks.get_block(named_block.name) {
|
||||
None => self.render_maybe_body(
|
||||
&named_block.contents,
|
||||
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
|
||||
blocks,
|
||||
),
|
||||
Some(interior) => self.render_maybe_body(
|
||||
interior,
|
||||
Some(inline_partial) => self.render_maybe_body(
|
||||
inline_partial,
|
||||
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),
|
||||
blocks,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user