Finished implementing Named blocks and inline partials.
This commit is contained in:
parent
403f9e6530
commit
55f816b53f
@ -205,7 +205,22 @@ impl<'a> DustRenderer<'a> {
|
|||||||
return Ok("".to_owned());
|
return Ok("".to_owned());
|
||||||
}
|
}
|
||||||
DustTag::DTBlock(named_block) => {
|
DustTag::DTBlock(named_block) => {
|
||||||
// TODO: Implement
|
match blocks.get_block(named_block.name) {
|
||||||
|
None => match &named_block.contents {
|
||||||
|
None => return Ok("".to_owned()),
|
||||||
|
Some(body) => {
|
||||||
|
let rendered_content = self.render_body(body, breadcrumbs, blocks)?;
|
||||||
|
return Ok(rendered_content);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Some(interior) => match interior {
|
||||||
|
None => return Ok("".to_owned()),
|
||||||
|
Some(body) => {
|
||||||
|
let rendered_content = self.render_body(body, breadcrumbs, blocks)?;
|
||||||
|
return Ok(rendered_content);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
_ => (), // TODO: Implement the rest
|
_ => (), // TODO: Implement the rest
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user