handlebars

Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. Handlebars is largely compatible with Mustache templates. In most cases it is possible to swap out Mustache with Handlebars and continue using your current templates. Complete details can be found here.

下标

    {{#each list}}
        {{@index}}
    {{/each}}

第一个、最后一个

    {{#each list}}
        {{#if @first}}
            First!
        {{/if}}
    {{/each}}
    {{#each list}}
        {{#if @last}}
            Last!
        {{/if}}
    {{/each}}