Commit c3cc9e5a authored by Vadym Gidulian's avatar Vadym Gidulian

Added Pug support

parent beb81fde
......@@ -7,6 +7,7 @@ var nano = require('gulp-cssnano');
var noop = require('gulp-empty');
var htmlMin = require('gulp-htmlmin');
var less = require('gulp-less');
var pug = require('gulp-pug');
var rename = require('gulp-rename');
var streamify = require('gulp-streamify');
var uglify = require('gulp-uglify');
......@@ -51,6 +52,14 @@ var paths = new function() {
this.less = this.lessDir + '/index.less';
this.lessFiles = this.lessDir + '/**/*.less';
this.lessOut = this.distDir + '/css';
this.pugDir = this.srcDir + '/pug';
this.pug = [
this.pugDir + '/**/*.pug',
'!' + this.pugDir + '/includes/**/*'
];
this.pugFiles = this.pugDir + '/**/*';
this.pugOut = this.distDir;
};
// Files
......@@ -81,7 +90,12 @@ gulp.task('html-min', function () {
}))
.pipe(gulp.dest(paths.htmlOut));
});
gulp.task('markup', ['html-min']);
gulp.task('pug-compile', function () {
return gulp.src(paths.pug)
.pipe(pug())
.pipe(gulp.dest(paths.pugOut));
});
gulp.task('markup', ['html-min', 'pug-compile']);
// Scripts
......@@ -116,7 +130,7 @@ gulp.task('test', ['pretest', 'files', 'images', 'markup', 'scripts', 'styles'])
gulp.task('watch', ['pretest'], function () {
failSafe = true;
gulp.watch(paths.files, ['files']);
gulp.watch(paths.htmlFiles, ['markup']);
gulp.watch([paths.htmlFiles, paths.pugFiles], ['markup']);
gulp.watch(paths.imgFiles, ['images']);
gulp.watch(paths.jsFiles, ['scripts']);
gulp.watch([paths.cssFiles, paths.lessFiles], ['styles']);
......
mixin head(title)
head
meta(charset="UTF-8")
title= title
script(async src="js/script.all.min.js")
link(rel="stylesheet" href="css/style.all.min.css")
block
include includes/mixins
doctype html
html(lang="en")
+head('Project')
body
// Code goes here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment