Inline partials and blocks worked as-is.
This commit is contained in:
		
							parent
							
								
									250d428464
								
							
						
					
					
						commit
						c8de395038
					
				| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander