gulp.task('build-dev-php', [ 'clean-php' ], function ()
{
    return gulp.src('./frontend/jade/*.jade')
        .pipe(jade({ pretty: true }))
        .on('error', handleErr)
        .pipe(gulp.dest('./'))
        .pipe(livereload());
});
gulp.task('templates', function() {
	gulp.src(paths.templates.src)
		.pipe(plumber())
		.pipe(jade({
			pretty: '\t'	// Set to false to minify/uglify the PHP
		}))
		.pipe(plumber.stop())
		.pipe(gulp.dest(paths.templates.dest));
});
g.task("jade",function(){
	var LOCAL = {};
	g.src(srcPath+'html/**/*.jade')
	.pipe(plumber())
	.pipe(jade({
		pretty:true
	}))
	.pipe(g.dest(destPath+'fuel/app/views/'))

})
gulp.task('templates', function() {
  return gulp.src('./lib/*.jade')
    .pipe(jade({
      pretty: true,
      locals: {
        title: 'OMG THIS IS THE TITLE'
      }
    }))
    .pipe(gulp.dest('../lovster/'))
    .pipe(notify({ message: 'jade compiled' }));
});
gulp.task('jade', function(){
  gulp.src([
  	'./resources/assets/jade/*.*',
  	// './resources/assets/jade/partial/*.*',
  	// './resources/assets/jade/directive/*.*'
  	], 
  	{'base' : './resources/assets/jade'})
    .pipe(jade({
    	pretty: true
    }))
    .pipe(gulp.dest('./resources/views/'))
});
// function jade_watch(from, to) {
//   return new Promise(function(resolve, reject) {
//     var promises = []
//     for (var i = 0 i < theme.jade_registry.length i++) {
//       promises.push(
//         function() {
//           return new Promise(function(resolve, reject) {
//             theme.jade_watchers.push(new Gaze(theme.jade_registry[i][0]))
//             theme.jade_watchers[theme.jade_watchers.length-1].on('all', function(event, filepath) { })
//           })
//         }
//       )
//     }
//     Promise.all(promises).then(resolve()).catch(reject())
//   })
// }
///////////////////////////////////////////////////////////////////////////////
// function jade_dir(from, to) {
//   return new Promise(function(resolve, reject) {
//     from = path.join(root, from)
//     to = path.join(theme.dist, to)
//     console.log(theme.general_locals)
//     console.log(theme.jade.locals)
//     var foo = merge(theme.general_locals, theme.jade.locals)
//     console.log('merged:'+foo)
//     gulp.src(from)
//       .pipe(jade({
//         locals: foo
//       }))
//       .pipe(gulp.dest(to))
//     resolve()
//   })
// }
// function jade_dirs() {
//   return new Promise(function(resolve, reject) {
//     var promises = []
//     for (var i = 0 i < theme.jade_registry.length i++) {
//       promises.push(jade_dir(theme.jade_registry[i][0], theme.jade_registry[i][1]))
//     }
//     Promise.all(promises).then(resolve())
//   })
// }
function jade_dir(from, to) {
  // from = path.join(root, from)
  // to = path.join(theme.dist, to)
  console.log(theme.general_locals)
  console.log(theme.jade.locals)
  var foo = theme.jade.locals
  console.log('merged:'+foo)
  console.log('starting dulp-jade-php: "'+from+'"->"'+to+'"')
  return gulp.src(from)
    .pipe(jade({
      locals: foo
    }))
    .pipe(gulp.dest(to))
}
Exemple #7
0
gulp.task( 'jade-php', function () {
    return gulp.src( [ 'jade/**/*.php.jade', '!jade/includes/**/*.php.jade' ] )
        .pipe( plumber( {
            errorHandler: function ( err ) {
                console.error( 'jade-php error' );
                console.error( err );
            }
        }))
        .pipe( rename( function ( path ) {
            path.basename = path.basename.replace( '.php', '' );
        }))
        .pipe( jadePhp( { pretty: USE_JADE_PRETTY, usestrip: true } ) )
        .pipe( gulp.dest( DESTINATION ) );
});
Exemple #8
0
gulp.task('pages', function(){
  return gulp.src([paths.pages])
    .pipe(plumber({
      errorHandler: function (error) {
        console.log(error.message);
        this.emit('end');
    }}))
    .pipe(jade({
        pretty: '\t',
        locals:{
          echo:function(str){
              return "<?php echo $"+str+"; ?>"
          }
        }
    }))
    .pipe(gulp.dest(paths.pagesDest))
    .pipe(browserSync.reload({stream:true}))
});
gulp.task('build-php', [ 'clean-php' ], function ()
{
    return gulp.src('./frontend/jade/*.jade')
        .pipe(jade())
        .pipe(gulp.dest('./'));
});
Exemple #10
0
gulp.task('jade', function(){
  gulp.src(jade_src)
    .on('error', util.log)
    .pipe(jade())
    .pipe(gulp.dest(jade_dest));
});
Exemple #11
0
gulp.task('jade', function() {
  gulp.src('src/views/**/*.jade')
    .pipe(jade())
    .pipe(gulp.dest('./'));
});
Exemple #12
0
gulp.task('templates', function() {
	gulp.src(paths.templates.src)
	.pipe(jade({pretty:true}))
	.pipe(gulp.dest(paths.templates.dest));
});