Adding task to build pages wrapped in a template

This commit is contained in:
Jeff Avallone 2014-11-23 12:00:07 -05:00
parent c898f7b5ec
commit 342cf8d5bb
5 changed files with 21 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
build

View File

@ -1,5 +1,12 @@
var gulp = require('gulp');
var gulp = require('gulp'),
wrap = require('gulp-wrap');
gulp.task('default', function() {
console.log('Default task');
});
gulp.task('markup', function() {
return gulp.src('./src/**/*.html')
.pipe(wrap({ src: './template.html' }))
.pipe(gulp.dest('./build'))
});

View File

@ -10,6 +10,7 @@
"license": "MIT",
"private": true,
"devDependencies": {
"gulp": "^3.8.10"
"gulp": "^3.8.10",
"gulp-wrap": "^0.5.0"
}
}

1
src/index.html Normal file
View File

@ -0,0 +1 @@
<h1>Demo page</h1>

9
template.html Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
</head>
<body>
${ contents }
</body>
</html>