gulp-handlebars-render
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "gulp-handlebars-render", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Renders handlebars templates", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"YOLO\" && exit 0" | ||
"test": "npm run unit && npm run cov", | ||
"unit": "mocha -R spec", | ||
"cov": "mocha -r blanket -R travis-cov" | ||
}, | ||
@@ -19,2 +21,11 @@ "repository": { | ||
], | ||
"config": { | ||
"blanket": { | ||
"pattern": "index.js", | ||
"data-cover-never": "node_modules" | ||
}, | ||
"travis-cov": { | ||
"threshold": 80 | ||
} | ||
}, | ||
"author": "Mark Wilkerson <mark@segfalwt.net>", | ||
@@ -30,3 +41,11 @@ "license": "MIT", | ||
"through2": "^0.6.3" | ||
}, | ||
"devDependencies": { | ||
"blanket": "^1.1.6", | ||
"chai": "^1.9.2", | ||
"event-stream": "^3.1.7", | ||
"mocha": "^1.21.4", | ||
"travis-cov": "^0.2.5", | ||
"vinyl": "^0.4.3" | ||
} | ||
} |
@@ -6,2 +6,42 @@ gulp-handlebars-render [![Build Status](https://travis-ci.org/markhuge/gulp-handlebars-render.svg)](https://travis-ci.org/markhuge/gulp-handlebars-render) | ||
Don't use me yet. Mark is a jerk and is deploying this for personal use before he writes tests. | ||
# Abstract | ||
My usecase is fully rendering hbs templates with data for livereload preview. | ||
# Install | ||
`npm install gulp-handlebars-render --save-dev` | ||
# Usage | ||
The plugin accepts a data object, which it will apply to any handlebars templates that are passed into it. | ||
The output will be a rendered HTML file per template. | ||
```javascript | ||
var gulp = require('gulp'), | ||
connect = require('gulp-connect'), | ||
cache = require('gulp-cached'), | ||
render = require('gulp-handlebars-render'); | ||
var content = { | ||
title: "Lorem ipsum dolor sit amet" | ||
author: "Frindle Babbin" | ||
content: "This is a post" | ||
} | ||
gulp.task('connect', function() { | ||
connect.server({ | ||
root: 'build/', | ||
livereload: true | ||
}); | ||
}); | ||
gulp.task('html', function () { | ||
gulp.src('./src/templates/*.hbs') | ||
.pipe(cache('html')) | ||
.pipe(render(content)) | ||
.pipe(gulp.dest('build/')) | ||
.pipe(connect.reload()); | ||
}); | ||
``` |
Sorry, the diff of this file is not supported yet
6084
7
52
46
6