raycmorgan/Mu plugin for [gulp][https://github.com/wearefractal/gulp]
First, install gulp-mu2
as a development dependency:
npm install --save-dev gulp-mu2
Then, add it to your gulpfile.js
var mu2 = require("gulp-mu2");
gulp.src("./page/*.html")
.pipe(mu2({title: "my page"}, {root: "./templates"}))
.pipe(gulp.dest("./dist"));
You may also pass a json file containing all some data for the view, like so:
gulp.src("./page/*.html")
.pipe(mu2("./templates/global.json", {root: "./templates"}))
.pipe(gulp.dest("./dist"));
If a file with the same name but a json extension exist next to the template page, It will get loaded and will be used as data in the template.
Type: hash
or string
Default: undefined
Type: hash
Default: { }
The options object to configure the plugin.
Type: string
Default: the path of the current file
Type: string
Default: the extension of the current file