Node package project that lets you quickly setup and test a Jekyll
site using Bourbon and Neat
with gulp
.
Make sure you have Node.js
installed on your computer. If not, visit here and download the stable version.
Node.js
comes with npm
installed so you should have a version of npm. However, npm gets updated more frequently than Node does, so you'll want to make sure it's the latest version.
sudo npm install npm -g
In order to build out your project, you'll need to install gulp
since it will be doing most of the heavy lifting for us.
Note: Using the -g tag installs the package globally on your machine so that it can be used anytime and anywhere.
npm install gulp -g
Clone the repository for your new project and download it locally to your machine. Once its on your machine, open your terminal and navigate to the root folder of the new project. Then run the following command to install of the required files used for development only:
npm install
This looks in the package.json folder and installs all of the dependencies listed into a new folder called node_modules. You should never have to edit or navigate into the node_modules folder.
The first time you setup the files on your computer run the default gulp command by typing the following command:
gulp
This allows the files to build out so that when you run gulp serve you'll be able to see your project right away
This is going to be the gulp command you use the most. Running gulp serve is going to take your working files in the src
folder and build them out to the _site
folder. It will also include .min
files for your CSS
and JavaScript
and also reduce your image file sizes.
gulp serve
gulp serve
usesbrowser-sync
for reloading the web page during changes and also runsjekyll build
with--watch --incremental --drafts
.
If you simply want to run the scripts that give you minified CSS and JavaScript files and reduce image sizes then this is the command you use:
gulp minify
gulp minify
usesgulp-cssnano
,gulp-uglify
,gulp-sourcemaps
,gulp-imagemin
,imagemin-pngquant
, andgulp-rename
for its clean up.
Once you are done with all of your edits and want to build out your final files to the _site
folder, run the following command:
gulp build
gulp build
runs the same processes asgulp serve
andgulp minify
but doesn't load the browser.
If you ever feel the need to remove the _site
folder so that you have a clean build to work with all you need to do is run the command:
gulp clean
gulp clean
usesdel
to remove the_site
directory from the project
To test and find any css
or JavaScript
errors simply run the command:
gulp test
gulp test
usesgulp-csslint
to testcss
andgulp-jshint
to testJavaScript
.