0.6.2 • Published 9 months ago

@doamatto/gulp-compile-handlebars v0.6.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

gulp-compile-handlebars

Forked from gulp-template, inspired by grunt-compile-handlebars, then forked again from kaanon/gulp-compile-handlebars.

Compile Handlebars templates

Install

Install with npmnpm install --save-dev gulp-compile-handlebars

Options

  • ignorePartials : ignores any unknown partials. Useful if you only want to handle part of the file
  • partials : Javascript object that will fill in partials using strings
  • batch : Javascript array of filepaths to use as partials
  • helpers : Javascript functions to stand in for helpers used in the handlebars files
  • compile : compile options. See handlebars reference for possible values

handlebars.Handlebars

Access the Handlebars library from the handlebars.Handlebars property.

var handlebars = require('gulp-compile-handlebars');
var safestring = new handlebars.Handlebars.SafeString('<strong>HELLO! KAANON</strong>');

Works with gulp-data

Use gulp-data to pass a data object to the template based on the handlebars file being processed. If you pass template data, this will be extended with the object from gulp-data.

See gulp-data for usage examples.