Stream a compiled Jekyll site with Gulp
Forked from gulp-jekyll
Example gulpfile.js
, shown with defaults:
const gulp = require('gulp');
const jekyll = require('gulp-jekyll');
gulp.task('default', () => {
// in addition, ANY COMMAND-LINE FLAG OR OPTION to the `jekyll` executable
// can be specified in the `options` object!
const options = {
bundleExec: false, // exec jekyll w/ "bundle exec"
quiet: true, // suppress jekyll output; implies "--trace"
safe: false, // run Jekyll in "safe" mode
cwd: process.cwd(), // below paths will be relative to this
layouts: '_layouts', // where your layouts live
plugins: '_plugins' // where your plugins live
// source: '/path/to/source' // overrides gulp.src() above
// destination: '_site' // can be used instead of gulp.dest()
};
return gulp.src(process.cwd()) // where your site source lives; this is
.pipe(jekyll(options))
.pipe(gulp.dest('_site'));
});
If you are using GitHub Pages with the recommended method, then you'll want bundleExec: true
.
gulp-jekyll
You'd want to use this package instead of gulp-jekyll
if you want to pipe Jekyll's output somewhere.
The main differences are:
gulp.src()
(or the source
property) to the plugin; Jekyll operates on entire directories; not files!destination
property, the generated site disappears into the ethernpm install gulp-jekyll-stream gulp -D
README.md
:wink:jekyll
command-line optionsChristopher Hiller, based on code by Danny Garcia.
MIT