gulp-dust-html

0.0.6 • Public • Published

Render dust templates into HTML

Issues with the output should be reported on the Dust issue tracker.

Install

$ npm install --save-dev gulp-dust-html dustjs-linkedin

Usage

var gulp = require('gulp');
var dust = require('dustjs-linkedin');
dust.helpers = require('dustjs-helpers').helpers;
var dusthtml = require('gulp-dust-html');
 
gulp.task('default', function () {
  return gulp.src('templates/index.html')
     .pipe(dusthtml({
       basePath: 'templates',
           data: data
         }))
     .pipe(gulp.dest('dist'));
});

API

dust([options])

options

basePath

Type: string
Default: '.'

Relative templates directory path (used to resolve partials). Example: templates

whitespace

Type: boolean
Default: false

Preserve whitespace.

data

Type: object or function Default: {}

Context which is passed to dust templates. If a function is provided the function will be called with one parameter, the name of the file

defaultExt

Type: string Default: .dust

Default extension used for templates

Todo

  • Update tests to reflect the new codebase
  • Think of a better way to handle context passing (maybe a contents directory?)

License

MIT

Package Sidebar

Install

npm i gulp-dust-html

Weekly Downloads

6

Version

0.0.6

License

MIT

Last publish

Collaborators

  • framp