Commit e8a19e31 authored by Nikolay Gromov's avatar Nikolay Gromov

Добавил компиляцию pug

parent 24bc2ba4
{
"indent_size": 2,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 5,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 2,
"end_with_newline": true,
"html": {
"unformatted": [
"a",
"abbr",
"acronym",
"address",
"area",
"audio",
"b",
"bdi",
"bdo",
"big",
"br",
"button",
"canvas",
"cite",
"code",
"data",
"datalist",
"del",
"dfn",
"dt",
"em",
"embed",
"i",
"iframe",
"img",
"input",
"ins",
"ins",
"kbd",
"keygen",
"label",
"map",
"mark",
"math",
"meter",
"noscript",
"object",
"output",
"progress",
"q",
"ruby",
"s",
"samp",
"select",
"small",
"span",
"strike",
"strong",
"sub",
"sup",
"template",
"text",
"textarea",
"time",
"tt",
"u",
"var",
"video",
"wbr"
],
"js": {
"end_with_newline": false
}
}
}
......@@ -387,6 +387,21 @@ gulp.task('html', function() {
.pipe(gulp.dest(dirs.buildPath));
});
// Сборка Pug (приоритет при совпадении имён файлов выше, чем у HTML)
gulp.task('pug', function() {
const pug = require('gulp-pug');
const htmlbeautify = require('gulp-html-beautify');
console.log('---------- сборка Pug');
return gulp.src([
dirs.srcPath + '/*.pug',
])
.pipe(plumber())
.pipe(pug())
.pipe(realFavicon.injectFaviconMarkups(JSON.parse(fs.readFileSync(faviconData)).favicon.html_code))
.pipe(htmlbeautify())
.pipe(gulp.dest(dirs.buildPath));
});
// Конкатенация и углификация Javascript
gulp.task('js', function (callback) {
const uglify = require('gulp-uglify');
......@@ -448,6 +463,7 @@ gulp.task('build', function (callback) {
['sprite:svg', 'sprite:png', 'favicons'],
['style', 'style:single', 'js', 'copy:css', 'copy:img', 'copy:js', 'copy:fonts'],
'html',
'pug',
callback
);
});
......@@ -500,6 +516,10 @@ gulp.task('serve', ['build'], function() {
'_include/*.html',
dirs.blocksDirName + '/**/*.html'
], {cwd: dirs.srcPath}, ['watch:html']);
// Слежение за pug
gulp.watch([
dirs.srcPath + '/**/*.pug',
], ['watch:pug']);
// Слежение за JS
if(lists.js.length) {
gulp.watch(lists.js, ['watch:js']);
......@@ -519,6 +539,7 @@ gulp.task('watch:img', ['copy:img'], reload);
gulp.task('watch:copied:js', ['copy:js'], reload);
gulp.task('watch:fonts', ['copy:fonts'], reload);
gulp.task('watch:html', ['html'], reload);
gulp.task('watch:pug', ['pug'], reload);
gulp.task('watch:js', ['js'], reload);
gulp.task('watch:sprite:svg', ['sprite:svg'], reload);
gulp.task('watch:sprite:png', ['sprite:png'], reload);
......
<!DOCTYPE html>
html(lang="en")
head
meta(charset="UTF-8")
title Document
body
p 1
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