Basically, I have a set of files that I process using markdowns and what not. After doing this initial processing, I would like to split the stream into two:
- Display 1..1 first with additional processing, such as layout
- Secondly, matching all files in one, for example, an index, without applying the layouts mentioned above.
Is it possible to save the stream in a variable and just save the pipeline? Here is my current task:
gulp.task('default', function() {
var entries = gulp.src('./log/*.md')
.pipe(frontMatter())
.pipe(markdown());
var templated = entries
.pipe(applyTemplate())
.pipe(gulp.dest('./build/log'));
var index = entries
.pipe(index())
.pipe(applyIndexTemplate())
.pipe(gulp.dest('./build'));
return merge(templated, index);
}
I could use lazypipe and / or just construct the channel several times, but is there any other way?
source
share