Render batches of jade templates, with custom options, data and locals.
Install
npm install jade-renderer
Usage
var render =
render(pages, options, cb)
pages
an array of 'pages' to render. 'pages' look like this:
template: 'path/to/template' data: text: 'some arbitrary data' more: 'to pass to the template' { return 'may contain any js, including functions' }
options
is an options hashsrc
the source directory, defaults to PWDdest
the destination directory, defaults to PWDlocals
locals to be passed to all views that are rendered (useful for view helpers)
cb
is the callbackfunction (err) {}
(err
is null if ok)
Eg: