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
.
You'd want to use this package instead of gulp-jekyll
if you want to pipe Jekyll's output somewhere.
The main differences are:
- You must provide a directory path using
gulp.src()
(or thesource
property) to the plugin; Jekyll operates on entire directories; not files! - The output of this stream is all the files which Jekyll generated
- If you neglect to pipe this plugin's output, and do not specify the
destination
property, the generated site disappears into the ether
npm install gulp-jekyll-stream gulp -D
- v1.0.1: Update
README.md
๐ - v1.0.0:
- New features:
- Support any and all
jekyll
command-line options
- Support any and all
- Bug fixes?
- Maybe Windows support via cross-spawn
- Breaking changes:
- Update dependencies
- Update dev depenedncies
- Require Node.js v6 or newer
- New features:
- v0.1.0: Initial Release
Christopher Hiller, based on code by Danny Garcia.
MIT