A modern and customizable asset pipeline for Jekyll projects. Processes your SASS/SCSS, JavaScript, images and makes your development workflow a lot easier.
Experiencing any issues or do you have ideas what could be added / improved? Report an issue.
Ever developed a website using Jekyll or any other static site generator and struggled because...
This boilerplate project might be something for you then. Without any configuration, you can start building your Jekyll website and let it handle your JavaScript, CSS and images. Thanks to Gulp and a simple config file, setting up the development process is pretty much a piece of cake.
build
and serve
commands.Download this repository as a ZIP using your browser.
// config.js
// ---------------------------------
// CSS configuration
var css = {
input: {
path: 'assets/scss',
filename: 'styles.scss'
},
output: {
path: 'css',
filename: 'styles.min.css'
},
options: {
compressed: true,
prefixed: true,
purge: true,
sourcemap: true,
browserSupport: ['last 2 versions']
}
};
Option | Type | Description |
---|---|---|
input.path |
String |
The path (without filename) to your SASS / SCSS. |
ìnput.filename |
String |
The name of your main stylesheet (usually imports all the other files). You can use a wildcard like *.scss . |
output.path |
String |
The path (without filename) for outputting the processed CSS. |
output.filename |
String |
The final name of your processed CSS file. |
options.compressed |
Boolean |
Whether to minify/compress the CSS or leave it as is. |
options.prefixed |
Boolean |
Whether to prefix the CSS for older browsers or not. |
options.purge |
Boolean |
If enabled, it will analyze your HTML files and remove all the CSS that is not used in any of these files. Takes a few seconds depending on your project size. |
options.sourcemap |
Boolean |
Creates a sourcemap for your CSS if enabled. |
options.browserSupport |
Array |
If you choose to prefix your CSS, this option is used to determine the browser support. Expects the same arguments as with Browserslist. |
// config.js
// ---------------------------------
// JavaScript configuration
var js = {
input: {
path: 'assets/js',
filename: 'app.js'
},
output: {
path: 'js',
filename: 'app.min.js'
},
options: {
minify: true,
concat: false,
babel: true,
sourcemap: true,
}
};
Option | Type | Description |
---|---|---|
input.path |
String |
The path (without filename) to your JS. |
ìnput.filename |
String |
The name of your main JS file. If you write *.js , you can process as many files as you want. |
output.path |
String |
The path (without filename) for outputting the processed CSS. |
output.filename |
String |
The final name of your processed CSS file. |
options.minify |
Boolean |
Whether to minify the JS or leave it as is. |
options.concat |
Boolean |
Whether to concat the JS or not. |
options.babel |
Boolean |
If enabled, compiles EcmaScript 6/7/8 or newer into EcmaScript 5. |
options.sourcemap |
Boolean |
Creates a sourcemap for your JS if enabled. |
// config.js
// ---------------------------------
// Image configuration
var images = {
input: {
path: 'assets/images',
filename: '**/*.{png,gif,jpg,jpeg}'
},
output: {
path: 'images'
},
options: {
compress: true,
webp: true,
imagemin: {
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{ 'removeViewBox': true }]
}
}
};
Option | Type | Description |
---|---|---|
input.path |
String |
The path (without filename) to your images. |
ìnput.filename |
String |
The name of your image files. You can use a wildcard like in the default config. |
output.path |
String |
The path (without filename) for outputting the processed images. |
options.compress |
Boolean |
Whether to compress the images or leave them with their original file size. |
options.webp |
Boolean |
Whether to convert all the images into WEBP or not. |
options.imagemin |
Object |
Expects and object to configure the imagemin plugin. See here for further details. |
// config.js
// ---------------------------------
// Jekyll configuration
var jekyll = {
deployDir: '_site',
port: 4000
};
Option | Type | Description |
---|---|---|
input.deployDir |
String |
The folder for the deployed site. |
ìnput.port |
Number |
The port on which to serve the Jekyll development server. |
MIT © Andreas Remdt