jamboree/bustache

Insert a template into another template?

carolinebeltran opened this issue · 2 comments

Hello and thank you for such a nice library. Is there some way to include (or embed) one template into another template? For example:

{{header}}
{{EMBEDDED_TEMPLATE}}
{{footer}}

data.emplace("header", "Hello World!");
data.emplace("EMBEDDED_TEMPLATE", "{{header}} - {{footer}}");
data.emplace("footer", "Goodbye World!");

Actual output:

Hello World!
{{EMBEDDED_TEMPLATE}}
Goodbye World!

Desired output:

Hello World!
Hello World! - Goodbye World!
Goodbye World!

I think Partials is what you're looking for, see this example.

That was it Jamboree, thank you!