Skip to content

tunderdomb/gulp-dustin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-dustin

Install

npm i gulp-dustin --save

Usage

.copy(dest, resolvePath, options)

Copy browser scripts to the dest folder. Set the template base path to resolvePath. This path will be used in the browser to include templates like so:

resolvePath+template+".js"

where template is a template name like "layout/page", so this option should be something like /templates/ or an absolute dir where templates are compiled to.

options.dustinHelpers

Bundle built in dustin helpers.

options.dustHelpers

Bundle linkedin's dustjs-helpers.

options.userHelpers

Bundle user defined helpers matched by a glob pattern.

.compile(options)

Options are the same as for dustin.

.render(options, context)

Options are the same as for dustin. context will be passed to adapter.render under the hood.

var gulp = require("gulp")
var concat = require("gulp-concat")
var dustin = require("./index")

gulp.task("compile", function(  ){
  gulp
    .src("test/view/*.dust")
    .pipe(dustin.compile({
      "views": "test/view/",
      "whiteSpace": false
    }))
    .pipe(gulp.dest("test/template"))
    .pipe(concat("inputs.js"))
    .pipe(gulp.dest("test/template"))
})

gulp.task("render", function(  ){
  gulp
    .src("test/view/*.dust")
    .pipe(dustin.render({
      "views": "test/view/",
      "whiteSpace": false
    }, {
      title: "hello"
    }))
    .pipe(gulp.dest("test/renders"))
    .pipe(concat("inputs.html"))
    .pipe(gulp.dest("test/renders"))
})

dustin.client("test", "/view/", {
  custom: true,
  dust: true,
  user: "test/helpers/*.js"
})

gulp.task("default", ["compile", "render"])

Licence

MIT

About

Gulp plugin for dustin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published