npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

handlebars-helper-eachitems

0.1.2

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:0
$ npm install handlebars-helper-eachitems
DailyWeeklyMonthlyYearly

{{eachItems}} NPM version

{{eachItems}} block helper, iterating over a list of items

Quickstart

In the root of your project, run the following in the command line:

npm i handlebars-helper-eachItems --save-dev

Assemble config

If you use Assemble config and Grunt, in your Gruntfile simply add handlebars-helper-eachItems to the helpers property in the Assemble task or target options:

grunt.initConfig({
  assemble: {
    options: {
      // the 'handlebars-helper-eachItems' module must also be listed in
      // devDependencies for assemble to automatically resolve the helper
      helpers: ['handlebars-helper-eachItems', 'foo/*.js']
    }
    ...
  }
});

You can now use begin using the helper in your templates:

{{#eachItems pages}}
  <li{{#is ../page.dest this.dest}} class="active"{{/is}}>
    <a href="{{relative ../page.dest this.dest}}">{{@number}}</a>
  </li>
{{/eachItems}}

Author

  • [github/Jon Schlinkert](http://github.com/Jon Schlinkert)
  • [twitter/Jon Schlinkert](http://twitter.com/Jon Schlinkert)

License and Copyright

Licensed under the MIT License Copyright (c) Jon Schlinkert, contributors.