Temporarily remove YAML frontmatter from a file and put it back whenever you want.
npm install gulp-frontmatter-wrangler --save-dev
frontmatter.take(UNIQUE_NAMESPACE_STRING)
frontmatter.putBack(UNIQUE_NAMESPACE_STRING)
UNIQUE_NAMESPACE_STRING: A string to identify your specific task. Ex. "pug", "sass", or "my blog posts".
var gulp = require('gulp')
var frontmatter = require('gulp-frontmatter-wrangler')
gulp.task('default', function() {
return gulp.src('*.pug')
.pipe(frontmatter.take("pug")) // Remove the frontmatter
// Process your files however you want
.pipe(frontmatter.putBack("pug")) // Put the frontmatter back
.pipe(gulp.dest('dist/'))
})