Handlebars helper, alternative to built-in partials. Similar to handlebars-helper-partial, but this helper will allow wildcard (glob) patterns. Like Assemble itself, this helper will automatically determine the correct context to use, or a context may be explicitly passed in as a second parameter.
JavaScript CSS
Switch branches/tags
Nothing to show
Latest commit 8449163 Nov 10, 2014 @jonschlinkert jonschlinkert fix readme
Permalink
Failed to load latest commit information.
test v0.2.0 Nov 10, 2014
.assemblerc.yml update root files Nov 10, 2014
.gitattributes update root files Nov 10, 2014
.gitignore update metadata, docs Nov 10, 2014
.jshintrc update metadata, docs Nov 10, 2014
.travis.yml update root files Nov 10, 2014
.verbrc.md rebuild docs Nov 10, 2014
Gruntfile.js v0.2.0 Nov 10, 2014
LICENSE-MIT update metadata, docs Nov 10, 2014
README.md fix readme Nov 10, 2014
index.js v0.2.0 Nov 10, 2014
package.json fix readme Nov 10, 2014

README.md

handlebars-helper-include NPM version

Handlebars helper for using includes.

Install

Use npm to install the package: npm i handlebars-helper-include.

Register the helper

Register the helper in the assemble task in your project's Gruntfile to begin using it in templates:

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

Usage

Register includes

Tell assemble where to find the includes by adding an includes property to the task options:

assemble: {
  options: {
    includes: ['abc.hbs', 'xyz.hbs', 'foo/*.hbs']
  },
  files: {
    '_gh_pages/': ['templates/*.hbs']
  }
}

Use in templates

Define the name of the helper to include, without file extension:

{{include 'abc'}}

Optionally pass a context as the second parameter:

{{include 'xyz' this}}

Wildcard patterns

Globbing patterns may also be used:

{{include 'chapter-*'}}

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on November 09, 2014.