A set of gulp tasks and boilerplate setup for Jekyll projects
This is an opinionated Jekyll setup that takes a gulp instance and registers gulp tasks related to running Jekyll projects.
npm install jekyll-tasks --save
- Gulp
- Node.js >= v4
- Ruby
- Jekyll
- jekyll-feed gem (simply remove it from your config if you do not want it)
- jekyll-paginate gem (simply remove it from your config if you do not want it)
- Project setup
- Browser Sync and Local Dev server
- Sass, Autoprefixer, and minification of CSS
- Webpack and Babel
To use this library, pass in your "gulp" instance in your gulpfile.js to jekyll-tasks
let gulp = require('gulp');
require('jekyll-tasks')(gulp);
Once you do this, you can use the following
gulp setup-project
- Initializes your project src code in a directory calledsrc
. The directory structure looks like
src\
_drafts\
_includes\
_js\
index.js (this is the Webpack entry point)
_layouts\
_plugins\
_posts\
_scss\
var\
src\
main.scss (this is the Sass entry point)
builds\ (compiled resources)
static\
font\
images\
_config.yml
.editorconfig
404.html
archive.html
index.html
You should add the following to your .gitignore after your project is set up
_site
src/builds
gulp dev
- Launches your development server and begins watching your filesgulp build
- Builds your site
gulp jekyll-build
- Builds your jekyll site into_site
gulp jekyll-build:drafts
- Same asjekyll-build
but with drafts includedgulp jekyll-rebuild
- Same asjekyll-build:drafts
but reloads the pagegulp browser-sync
- Launches a browser-sync servergulp sass
- Compiles the development version of your CSSgulp sass:prod
- Same as the previous but the CSS is minifiedgulp webpack:dev
- Compiles the development version of your Javascriptgulp webpack:prod
- Compiles the production version of your Javascriptgulp watch
- Watches your file system for changes and executes the appropriate task
You can pass in an options object to overwrite defaults and set deployment information.
let gulp = require('gulp');
let options = {};
require('jekyll-tasks')(gulp, options);
options.webpackDevConfig
- Development Webpack Config. See the source code for the default configoptions.webpackProdConfig
- Production Webpack Config. See the source code for the default config
Released under the MIT License