S
S
SergeyKisliy2015-08-17 10:07:09
npm
SergeyKisliy, 2015-08-17 10:07:09

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

2 answer(s)
S
SergeyKisliy, 2015-08-17
@SergeyKisliy

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);

D
Denis Vasiliev, 2015-09-13
@corvus007

Try like this:
gulp.src('src/jade/**/*.jade' )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question