You can copy the yaml-code below and use it as frontmatter for an example page.
You can paste this URL into github issues to order to share your setup when filing bugs or questions
Handlebars:
Template
{{#list people}}{{firstname}} {{lastname}}{{/list}}
Preparation-Script
Handlebars.registerHelper("list", function(items, options) {
const itemsAsHtml = items.map(item => "<li>" + options.fn(item) + "</li>");
return "<ul>\n" + itemsAsHtml.join("\n") + "\n</ul>";
});
Input
{
people: [
{
firstname: "Yehuda",
lastname: "Katz",
},
{
firstname: "Carl",
lastname: "Lerche",
},
{
firstname: "Alan",
lastname: "Johnson",
},
],
}
Output
<ul>
<li>Yehuda Katz</li>
<li>Carl Lerche</li>
<li>Alan Johnson</li>
</ul>