feature: Add embed node#888
Conversation
| .config | ||
| .find_template(embed.path, Some(&self.input.path))?; | ||
| let mut embedded_context = | ||
| Context::new(self.input.config, &self.input.path, embed.nodes.as_slice())?; |
There was a problem hiding this comment.
There's missing errors for doing anything outside block tags. Some of these don't actually do anything (extends for example gets overwritten), but you're allowed to write macro and include nodes here, which seems weird (this is similar behavior to how normal extended templates work, so maybe not a real issue?)
There was a problem hiding this comment.
Yes, I see why this is problematic, but it's consistent. I think this is something, that should be fixed/improved in general.
Another real problem, that I mentioned in the issue (#488) is, that the compiler is not including the file when the embed is inside a block in an extended file. This problem however also exists for includes and I'm not sure how to approach this.
Co-authored-by: Matthew Taylor <[email protected]>
5633250 to
704f8f1
Compare
In memory of my old issue/feature request in #488, here is finally the implementation of it. Tests are included of cause.
I have (not yet) updated the documentation for it. If this feature and implementation is fine, I'm open for updating the documentation to describe the new possibilities.Edit: I did update the documentation now, as I think it might be easier to understand, what it's actually doing.