Common syntax for writing mustache templates.
You can find the official documentation here.
{
name: 'John',
isFeatured: true,
tags: ['Tag A', 'Tag B', 'Tag C'],
categories: [
{ name: 'Category A' },
{ name: 'Category B' },
{ name: 'Category C' },
],
image: 'https://website.com/path/image.jpg'
}
You can write your thumbnail template as such :
<h1>Hello {{name}} !!</h1>
{{#isFeatured}}
<p>isFeatured is truthy!</p>
{{/isFeatured}}
{{^foobar}}
<p>foobar is falsy!</p>
{{/foobar}}
<ul>
{{#tags}}
<li>{{.}}</li>
{{/tags}}
</ul>
<ul>
{{#categories}}
<li>{{name}}</li>
{{/categories}}
</ul>
This is useful for passing URLs in HTML attributes which contain special characters.
<img src="{{{imageUrl}}}" />