For a template like this:
{{#each sublinks}} <li><a href="#{{section}}">{{section}}</li> {{/each}}
You need a data structure as follows:
sublinks = [ { section: 'link1' }, { section: 'link2' }, //... ]
and in YAML, it will look like this:
sublinks: - section: link1 - section: link2
You can also use this YAML:
sublinks: - link1 - link2
with this template:
{{#each sublinks}} <li><a href="#{{.}}">{{.}}</li> {{/each}}
Your YAML corresponds to a data structure like this:
sublinks = [ { section: 'link1, link2' } ]
and this is not very useful if you do not want to split the string 'link1, link2' using the Handlebars helper.
source share