Handlebars:
Template
<div class="entry">
{{#if author}}
<h1>{{firstName}} {{lastName}}</h1>
{{/if}}
</div>
Preparation-Script
// Handlebars.registerHelper('loud', function(string) {
//    return string.toUpperCase()
// });
Input
{
  author: true,
  firstName: "Yehuda",
  lastName: "Katz",
}
Output
<div class="entry">
<h1>Yehuda Katz</h1>
</div>
最后更新: 1/11/2020, 3:46:21 PM