diff --git a/dist/dark/signature-dark.html b/dist/dark/signature-dark.html index 5e709c4..ef70da1 100644 --- a/dist/dark/signature-dark.html +++ b/dist/dark/signature-dark.html @@ -1 +1,94 @@ -
\ No newline at end of file + + + + + + + + + + + +
+ + + + + + +
+ + + + + \ No newline at end of file diff --git a/dist/dark/signature-reply-dark.html b/dist/dark/signature-reply-dark.html index 8c0d576..a515ff7 100644 --- a/dist/dark/signature-reply-dark.html +++ b/dist/dark/signature-reply-dark.html @@ -1 +1,69 @@ -
\ No newline at end of file + + + + + + + + + + + +
+ + + + + + + +
+ \ No newline at end of file diff --git a/dist/light/full-mail-light.html b/dist/light/full-mail-light.html index 75990f9..3277ec2 100644 --- a/dist/light/full-mail-light.html +++ b/dist/light/full-mail-light.html @@ -1 +1,125 @@ -
Hi there,
Thanks for writing up this email.
We are delighted to reply with a responsive template.
\ No newline at end of file + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Hi there, +
+ Thanks for writing up this email.
We are delighted to reply with a responsive template. +
+
+ + + + + \ No newline at end of file diff --git a/dist/light/signature-light.html b/dist/light/signature-light.html index 177898f..58ee892 100644 --- a/dist/light/signature-light.html +++ b/dist/light/signature-light.html @@ -1 +1,110 @@ -
\ No newline at end of file + + + + + + + + + + + +
+ + + + + + +
+ + + + + \ No newline at end of file diff --git a/dist/light/signature-reply-light.html b/dist/light/signature-reply-light.html index 17e3287..5c8cf8a 100644 --- a/dist/light/signature-reply-light.html +++ b/dist/light/signature-reply-light.html @@ -1 +1,83 @@ -
\ No newline at end of file + + + + + + + + + + + +
+ + + + + + +
+ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 9b45af9..9ba6135 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,12 +1,16 @@ 'use strict'; var gulp = require('gulp'), - wrench = require('wrench'); + wrench = require('wrench'), + plumber = require('gulp-plumber'); var options = { - src: 'src', + source: 'src', dist: 'dist', - workingDir: 'tmp' + workingDir: 'tmp', + src: function plumbedSrc(){ + return gulp.src.apply(gulp, arguments).pipe(plumber()); + } }; /** Load tasks from the '/tasks' directory. @@ -23,4 +27,4 @@ wrench }); /** By default templates will be built into '/dist', then gulp will watch for changes in '/src'. */ -gulp.task('default', ['dupe', 'postcss', 'less', 'sass', 'build', 'clean', 'watch']); \ No newline at end of file +gulp.task('default', ['dupe', 'less', 'sass', 'postcss', 'build', 'watch']); \ No newline at end of file diff --git a/package.json b/package.json index 74a2831..68707b9 100644 --- a/package.json +++ b/package.json @@ -24,18 +24,18 @@ "homepage": "https://github.com/fadeit/responsive-html-email-signature#readme", "devDependencies": { "autoprefixer": "^6.3.6", - "del": "~2.2.0", + "del": "^2.2.0", "gulp": "~3.9.1", "gulp-david": "~0.4.2", "gulp-inline-css": "~3.1.0", "gulp-inline-image-html": "~0.2.1", "gulp-minify-html": "~1.0.5", "gulp-minify-inline": "~0.2.1", + "gulp-plumber": "^1.1.0", "gulp-postcss": "^6.1.1", "gulp-preprocess": "~2.0.0", "gulp-rename": "~1.2.2", "q": "~1.4.1", - "run-sequence": "~1.1.5", "wrench": "~1.5.8" }, "dependencies": {} diff --git a/tasks/build.js b/tasks/build.js index 040ea8d..2d39a7c 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -12,7 +12,7 @@ var gulp = require('gulp'), inlineimg = require('gulp-inline-image-html'); function buildTask(options){ - gulp.task('build', function build(cb) { + gulp.task('build', ['dupe'], function build() { var promises = []; /** Makes templates for a given directory & its configurations. @@ -23,7 +23,7 @@ function buildTask(options){ function makeTemplates(dir, confItems){ confItems .forEach(function handleConf(conf){ - var cwd = options.src + '/' + dir; + var cwd = options.workingDir + '/' + dir; gulp .src([cwd + '/**/*.html', '!' + cwd + '/**/*.inc.html']) @@ -37,8 +37,8 @@ function buildTask(options){ preserveMediaQueries: true, removeStyleTags: false })) - .pipe(minifyHTML({quotes: true})) - .pipe(minifyInline()) + //.pipe(minifyHTML({quotes: true})) + //.pipe(minifyInline()) .pipe(rename(function rename(path){ path.dirname = dir; path.basename += '-' + conf.id; @@ -50,23 +50,24 @@ function buildTask(options){ /** Clean up & then read 'src' to generate templates (build entry point). */ del(options.dist).then(function buildStart(){ - /** Loop through dirs and load their conf files. - * Promisify all 'makeTemplate' calls and when resolved, make a call to the task `cb` to let gulp know we're done. - */ + /** Loop through dirs and load their conf files. + * Promisify all 'makeTemplate' calls and when resolved, make a call to the task `cb` to let gulp know we're done. + */ wrench - .readdirSyncRecursive(options.src) + .readdirSyncRecursive('./' + options.workingDir) .filter(function filterFiles(file) { - /** Read only folders, skip files. */ + + /* Read only folders, skip files. */ return (!file.match('/') && !file.match(/^\.+/g)) ? file : false; }) .forEach(function readConfigurations(dir){ /** NB: For 'watch' to properly work, the cache needs to be deleted before each require. */ - var confPath = './../' + options.src + '/' + dir + '/conf.js'; + var confPath = './../' + options.workingDir + '/' + dir + '/conf.js'; delete require.cache[require.resolve(confPath)]; promises.push(makeTemplates(dir, require(confPath))); }); - Q.all(promises).then(function buildReady(){ cb(); }); + Q.all(promises); }); }); } diff --git a/tasks/clean.js b/tasks/clean.js deleted file mode 100644 index e69de29..0000000 diff --git a/tasks/dupe.js b/tasks/dupe.js index e69de29..8aeaa4f 100644 --- a/tasks/dupe.js +++ b/tasks/dupe.js @@ -0,0 +1,16 @@ +'use strict'; + +var gulp = require('gulp'), + del = require('del'); + +function dupeTask(options){ + gulp.task('dupe', function(){ + del.sync([options.workingDir]); + + return options + .src(['src/**/*']) + .pipe(gulp.dest('./' + options.workingDir)); + }); +} + +module.exports = dupeTask; \ No newline at end of file diff --git a/tasks/less.js b/tasks/less.js index e69de29..6b87e81 100644 --- a/tasks/less.js +++ b/tasks/less.js @@ -0,0 +1,11 @@ +'use strict'; + +var gulp = require('gulp'); + +function lessTask(options){ + gulp.task('less', function(){ + //todo + }); +} + +module.exports = lessTask; \ No newline at end of file diff --git a/tasks/postcss.js b/tasks/postcss.js index be67fb7..81e2061 100644 --- a/tasks/postcss.js +++ b/tasks/postcss.js @@ -7,13 +7,27 @@ var gulp = require('gulp'), function postcssTask(options){ gulp.task('postcss', function () { var processors = [ - autoprefixer({browsers: ['Android', 'ChromeAndroid', 'FirefoxAndroid', 'Opera Mini', 'Chrome', 'Firefox', 'Explorer', 'Edge', 'iOS', 'Opera', 'Safari', 'ExplorerMobile']}), + autoprefixer({ + browsers: [ + 'Android', + 'ChromeAndroid', + 'FirefoxAndroid', + 'Opera Mini', + 'Chrome', + 'Firefox', + 'Explorer', + 'Edge', + 'iOS', + 'Opera', + 'Safari', + 'ExplorerMobile' + ] + }) ]; - //@TODO src & dest - return gulp.src('./src/*.css') + return gulp.src(options.workingDir + '/*.css') .pipe(postcss(processors)) - .pipe(gulp.dest('./tmp')); + .pipe(gulp.dest(options.workingDir)); }); } diff --git a/tasks/sass.js b/tasks/sass.js index e69de29..694b65d 100644 --- a/tasks/sass.js +++ b/tasks/sass.js @@ -0,0 +1,11 @@ +'use strict'; + +var gulp = require('gulp'); + +function sassTask(options){ + gulp.task('sass', function(){ + //todo + }); +} + +module.exports = sassTask; \ No newline at end of file diff --git a/tasks/watch.js b/tasks/watch.js index 7d4231a..0c05671 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -3,9 +3,17 @@ var gulp = require('gulp'); function watchTask(options){ - gulp.task('watch', function(){ - //@todo watch less & sass files - gulp.watch([options.src + '/**/*.html', options.src + '/**/*.css', options.src + '/**/conf.js'], ['dupe', 'postcss', 'less', 'sass', 'build', 'clean']); + gulp.task('watch', ['dupe', 'build'], function(){ + gulp.watch( + [ + options.source + '/**/*.html', + options.source + '/**/*.css', + options.source + '/**/*.sass', + options.source + '/**/*.less', + options.source + '/**/conf.js' + ], + ['dupe', 'less', 'sass', 'postcss', 'build'] + ); }); }