fix template builds
Joshua L Geschwendt
committed Mar 03, 2016
commit 4bcdfab805271361541761724fcb7b5b9f112c72
Showing 3
changed files with
21 additions
and 17 deletions
.gitignore
+1
-0
| @@ | @@ -1,3 +1,4 @@ |
| + | .publish/ |
| dist/ | |
| node_modules/ | |
| tmp/ | |
gulpfile.js
+14
-14
| @@ | @@ -8,22 +8,16 @@ var gulp = require('gulp') |
| var plug = require('gulp-load-plugins')({ lazy: true }) | |
| var inky = require('inky') | |
| - | var signatures = require('./src/signatures.json') |
| var builders = [] | |
| - | for (var i = 0; i < signatures.length; i++) { |
| - | var signature = signatures[i] |
| - | builders.push(function compileTemplate() { |
| + | var signatures = require('./src/signatures.json') |
| + | signatures.forEach(function(signature) { |
| + | builders.push(function() { |
| return gulp | |
| .src(['tmp/build/**/*.htm']) | |
| .pipe(plug.compileHandlebars(signature)) | |
| .pipe(gulp.dest('dist/' + signature.email)) | |
| }) | |
| - | } |
| - | |
| - | gulp.task('build', gulp.series(build, gulp.parallel.apply(this, builders))) |
| - | gulp.task('serve', gulp.series(build, gulp.parallel.apply(this, builders), gulp.parallel(startLocalhost, watch))) |
| - | |
| - | gulp.task('deploy', gulp.series(build, gulp.parallel.apply(this, builders)), deploy) |
| + | }) |
| const inkyOpts = {} | |
| function build() { | |
| @@ | @@ -47,7 +41,13 @@ function startLocalhost() { |
| }) | |
| } | |
| - | function deploy() { |
| - | return gulp.src('./dist/**/*') |
| - | .pipe(plug.ghPages()); |
| - | } |
| \ No newline at end of file | |
| + | function deploySignatures() { |
| + | console.log('starting deploy') |
| + | return gulp.src('dist/**/*') |
| + | .pipe(plug.debug()) |
| + | .pipe(plug.ghPages()) |
| + | } |
| + | |
| + | gulp.task('build', gulp.series(build, gulp.parallel.apply(gulp, builders))) |
| + | gulp.task('serve', gulp.series(build, gulp.parallel.apply(gulp, builders), gulp.parallel(startLocalhost, watch))) |
| + | gulp.task('deploy', gulp.series(build, gulp.parallel.apply(gulp, builders), deploySignatures)) |
| \ No newline at end of file | |
package.json
+6
-3
| @@ | @@ -4,6 +4,7 @@ |
| "description": "IMCS email signatures.", | |
| "main": "index.js", | |
| "scripts": { | |
| + | "build": "npm run gulp -- build", |
| "deploy": "npm run gulp -- deploy", | |
| "gulp": "node node_modules/.bin/gulp", | |
| "start": "npm run gulp -- serve", | |
| @@ | @@ -27,10 +28,12 @@ |
| "devDependencies": { | |
| "browser-sync": "2.11.1", | |
| "gulp": "gulpjs/gulp#56e3e56", | |
| - | "gulp-compile-handlebars": "^0.6.1", |
| + | "gulp-compile-handlebars": "0.6.1", |
| + | "gulp-debug": "2.1.2", |
| "gulp-deploy": "0.0.2", | |
| - | "gulp-inline-image-html": "^0.2.1", |
| - | "gulp-load-plugins": "^1.2.0", |
| + | "gulp-gh-pages": "0.5.4", |
| + | "gulp-inline-image-html": "0.2.1", |
| + | "gulp-load-plugins": "1.2.0", |
| "inky": "1.0.0" | |
| } | |
| } | |