Created
June 7, 2015 21:42
-
-
Save makefunstuff/71a3954a1c7a740d0c88 to your computer and use it in GitHub Desktop.
determine current view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('views', function() { | |
var views = config.views | |
return gulp.src(views.src) | |
.pipe($.plumber({errorHandler: $.notify.onError("Error: <%= error.message %>")})) | |
.pipe($.data(function(file) { | |
return _.extend(config.app, {currentView: path.basename(file.path).replace('.jade', '')}) | |
})) | |
.pipe($.jade({ | |
pretty: true, | |
data: config.app | |
})) | |
.pipe(gulp.dest(views.destination)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment