Finished implementing Named blocks and inline partials.

This commit is contained in:
Tom Alexander 2020-05-09 22:48:30 -04:00
parent 403f9e6530
commit 55f816b53f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -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
} }