Skip to content

Instantly share code, notes, and snippets.

@makefunstuff
Created June 7, 2015 21:42
Show Gist options
  • Save makefunstuff/71a3954a1c7a740d0c88 to your computer and use it in GitHub Desktop.
Save makefunstuff/71a3954a1c7a740d0c88 to your computer and use it in GitHub Desktop.
determine current view
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