'use strict';
// generated on 2014-06-15 using generator-gulp-webapp 0.1.0

var gulp = require('gulp');

// load plugins
var $ = require('gulp-load-plugins')();

var PORT = 5000,
    OUTPUT = 'dist',
    TMP = '.tmp';

gulp.task('styles', function () {
    return gulp.src('app/styles/main.scss')
        .pipe($.rubySass({
            style: 'expanded',
            precision: 10
        }))
        .pipe($.autoprefixer('last 1 version'))
        .pipe(gulp.dest(TMP + '/styles'))
        .pipe($.size());
});

gulp.task('scripts', function () {
    return gulp.src('app/scripts/**/*.js')
        .pipe($.jshint())
        .pipe($.jshint.reporter(require('jshint-stylish')))
        .pipe($.size());
});

gulp.task('html', ['styles', 'scripts'], function () {
    var jsFilter = $.filter('**/*.js');
    var cssFilter = $.filter('**/*.css');

    return gulp.src('app/*.html')
        .pipe($.useref.assets({searchPath: '{' + TMP + ',app}'}))
        .pipe(jsFilter)
        .pipe($.uglify())
        .pipe(jsFilter.restore())
        .pipe(cssFilter)
        .pipe($.csso())
        .pipe(cssFilter.restore())
        .pipe($.rev())
        .pipe($.useref.restore())
        .pipe($.useref())
        .pipe($.revReplace())
        .pipe(gulp.dest(OUTPUT))
        .pipe($.size());
});

gulp.task('images', function () {
    return gulp.src('app/images/**/*')
        .pipe($.cache($.imagemin({
            optimizationLevel: 3,
            progressive: true,
            interlaced: true
        })))
        .pipe(gulp.dest(OUTPUT + '/images'))
        .pipe($.size());
});

gulp.task('fonts', function () {
    return $.bowerFiles()
        .pipe($.filter('**/*.{eot,svg,ttf,woff}'))
        .pipe($.flatten())
        .pipe(gulp.dest(OUTPUT + '/fonts'))
        .pipe($.size());
});

gulp.task('extras', function () {
    return gulp.src(['app/*.*', '!app/*.html'], { dot: true })
        .pipe(gulp.dest(OUTPUT));
});

gulp.task('clean', function () {
    return gulp.src([TMP, OUTPUT], { read: false }).pipe($.clean());
});

gulp.task('build', ['html', 'images', 'fonts', 'extras']);

gulp.task('default', ['clean'], function () {
    gulp.start('build');
});

gulp.task('connect', function () {
    var connect = require('connect');
    var app = connect()
        .use(connect.static('app'))
        .use(connect.static(TMP))
        .use(connect.directory('app'));

    require('http').createServer(app)
        .listen(PORT)
        .on('listening', function () {
            console.log('Started connect web server on http://localhost:' + PORT);
        });
});

gulp.task('serve', ['connect', 'styles'], function () {
    require('opn')('http://localhost:' + PORT);
});

// inject bower components
gulp.task('wiredep', function () {
    var wiredep = require('wiredep').stream;

    gulp.src('app/styles/*.scss')
        .pipe(wiredep({
            directory: 'app/bower_components'
        }))
        .pipe(gulp.dest('app/styles'));

    gulp.src('app/*.html')
        .pipe(wiredep({
            directory: 'app/bower_components',
            exclude: ['bootstrap-sass-official']
        }))
        .pipe(gulp.dest('app'));
});

gulp.task('watch', ['connect', 'serve'], function () {
    gulp.watch('app/styles/**/*.scss', ['styles']);
    gulp.watch('app/scripts/**/*.js', ['scripts']);
    gulp.watch('app/images/**/*', ['images']);
    gulp.watch('bower.json', ['wiredep']);
});

@@ -212,16 +212,242 @@
 .tmp';%0A%0A
+gulp.task('jade', function () %7B%0A    // render jade files excepts templates%0A    return gulp.src(%5B'app/**/*.jade', '!app/**/_*.jade', '!app/includes/**/*.jade'%5D)%0A        .pipe($.jade())%0A        .pipe(gulp.dest(TMP + '/'));%0A%7D);%0A%0A
 gulp.tas
@@ -464,32 +464,32 @@
 , function () %7B%0A
-
     return gulp.
@@ -941,24 +941,32 @@
 sk('html', %5B
+'jade', 
 'styles', 's
@@ -1084,32 +1084,33 @@
 return gulp.src(
+%5B
 'app/*.html')%0A  
@@ -1097,32 +1097,53 @@
 rc(%5B'app/*.html'
+, TMP + '/**/*.html'%5D
 )%0A        .pipe(
@@ -2118,16 +2118,34 @@
 /*.html'
+, '!app/**/*.jade'
 %5D, %7B dot
@@ -2873,16 +2873,24 @@
 onnect',
+ 'jade',
  'styles
@@ -3469,32 +3469,32 @@
 , function () %7B%0A
-
     gulp.watch('
@@ -3525,24 +3525,67 @@
 'styles'%5D);%0A
+    gulp.watch('app/**/*.jade', %5B'jade'%5D);%0A
     gulp.wat

build jade file