Answer the question
In order to leave comments, you need to log in
How to make gulp-jade so that html pages are generated in accordance with the file structure of jade files?
Hello.
Please tell me how to make the generated HTML files preserve the structure of JADE files.
Structure:
index.jade
contact.jade
/assortiment
--1.jade
--2.jade
--3.jade
Here is a piece of gulp-jade
gulp.task('jade', function(){
gulp.src(['src/jade/**.jade', 'src/jade/assortiment/**.jade'])
.pipe(jade({pretty: true}))
.on('error', console.log) // Выводим ошибки в консоль
.pipe(gulp.dest('src/')) // Выводим сгенерированные HTML-файлы
.pipe(reload({stream: true}));
});
gulp.task('jade-watch', ['jade'], reload);
Answer the question
In order to leave comments, you need to log in
I decided with this crutch:
// Jade
gulp.task('jade', function(){
gulp.src(['src/jade/**/**.jade','!src/jade/_base/**.jade','!src/jade/_project/**.jade','!src/jade/tpl/**.jade'])
.pipe(jade({pretty: true}))
.on('error', console.log) // Выводим ошибки в консоль
.pipe(gulp.dest('src/')) // Выводим сгенерированные HTML-файлы
.pipe(reload({stream: true}));
});
gulp.task('jade-watch', ['jade'], reload);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question