wycats / handlebars-site

56 stars 66 forks source link

Document wether or not indexes is a supported part of paths #202

Closed mortenbekditlevsen closed 4 years ago

mortenbekditlevsen commented 5 years ago

In a template, I can refer to an index of an array as:

{{myArray.0.myField}}

I am not certain wether this is by design or a subtlety of javascript, because if it is by design I would assume that I could use the same syntax for a block (like with):

{{#with myArray.0}}
{{myField}}
{{/with}}

But the above does not appear to work - the closest I can get is:

{{#with myArray}}
{{0.myField}}
{{/with}}

This works, but it would be neat if the index could be passed directly to the with block.

From the documentation I haven't been able to figure out wether or not it is supposed to be possible to use this kind of direct indexing or not.

milenvoutchev commented 5 years ago

Well, documentation seems abandoned since a while.

mortenbekditlevsen commented 5 years ago

Right, I have an open PR for a documentation fix, but it seems to have stranded.

nknapp commented 5 years ago

I have the small problem that the site generator does not work anymore with current ruby versions.

We should have something new, but I haven't had the chance to set it up.

nknapp commented 4 years ago

Something new is up: http://handlebarsjs.com/guide/expressions.html#literal-segments

nknapp commented 4 years ago

https will take a while to work, since the site just moved