Web development boilerplate based on Jekyll and Gulp with focus on performance for the user and for you as a developer. Takes care of the mundane, so you can focus on building great UI.
style.css
(preprocess SCSS, glob partials, create source maps, add vendor prefixes,
group media queries, minify, hash, and gzip).script.js
(concatenate, create source maps, minify, hash, and gzip)feature
images (i.e. big heavy graphics) to be served responsively.If you'd like to modify default structure, edit paths in gulpfile.js
and _config.yml
.
├── gulp # => gulp tasks for building the entire site
├── build # => built site and assets
├── source # => source Jekyll files and assets
| ├── _data # => JSON, XML, YML, or CSV data
| ├── _drafts # => Draft content (ignored in production mode)
| ├── _includes # => Components and partials written in Liquid/HTML
| ├── _layouts # => Page templates written in Liquid/HTML
| ├── _pages # => Static pages like 404.
| ├── _posts # => Content in markdown format (posts, articles, etc.)
| └── assets # => Static assets
| | ├── icons # => Separate SVG files (will be sprited and inlined in build process)
| | ├── img # => Image files
| | | ├── resize # => Images that will be resized by Gulp task
| | ├── js
| | | ├── components # => Our Javascript code
| | | ├── plugins # => jQuery plugins and 3rd party code snippets
| | | ├── vendor # => Vendor libraries like jQuery, Modernizr, CoffeeScript, etc.
| | └── css
| | ├── ...
| | └── style.scss # => CSS manifest file with all @imports
| └── robots.txt # => Make bots behave
├── .editorconfig # => Config to help our IDEs apply consistent editing rules
├── .gitignore # => Common Git ignore patterns are included by default
├── _config.dev.yml # => Jekyll config overrides for local development
├── _config.yml # => Main Jekyll configuration file
├── Gemfile # => Ruby dependencies list for Bundler
├── gulpfile.js # => Main Gulp tasks
├── package.json # => Node dependencies list for NPM
├── aws-credentials.json # => Credentials for deploying to Amazon S3
└── setup.sh # => Handy shell script to automate initial setup on Mac OS
Step 1: Clone or download this repo and open it in your command line tool of choice.
Step 2: Install Bundler and run bundle install
.
Step 3: Install Node.js and run npm install
.
Step 4: Install node-gyp
Step 5: Run gulp
and open http://localhost:4000
in your browser.
NOTE: If you're on Mac OS, there is a shell script included which automates
the setup. Just type ./setup.sh
in your Terminal app.
Below you'll find main Gulp commands. They are based on multiple subtasks which live in their own files in the gulp folder. They are named after what they do and are commented, so it should be easy to customize them.
gulp [--prod]
This is the default command, and probably the one you'll use the most. It builds your assets and site with development settings. You'll get sourcemaps, your drafts will be generated. As you are changing your posts, pages and assets they will automatically update and inject into your browser via BrowserSync.
gulp --prod
Once you are done and want to verify that everything works with production
settings you add the flag --prod
and your assets will be optimized. Your CSS,
JS and HTML will be minified and gzipped, plus the CSS and JS will be cache
busted. The images will be compressed and Jekyll will generate a site with all
your posts and no drafts.
gulp build [--prod]
This command is identical to the normal gulp [--prod]
however it will not
create a BrowserSync session in your browser.
gulp deploy
When you're done developing and have built your site with either gulp --prod
or gulp build --prod
you can deploy your site to Amazon S3. Don't forget to configure
aws-credentials.json.
gulp clean
Deletes your assets from their .tmp
directory as well as in build
. NOTE: Does
not delete images from .tmp
to reduce the time to build the site due to image optimizations.
gulp wipe
This will delete everything from .tmp
directory as well as in build
(images, assets, generated Jekyll site).
So why Goodrocket? Because a good rocket will take you really far really fast. And it won't explode in the process. I thought this was a good metaphor for a reliable web development boilerplate that focuses on performance for the user and for you as a developer.
Hint: there is a sister project Goodrocket CSS. It is a Sass-powered, mobile first, modular CSS bolierplate. Check it out.
Why another boilerplate? Two reasons. First, I wanted to learn how Gulp works. Second, I find it hard to use other people's boilerplates "as is". I have to understand fully what is under the hood to trust the system, and when I figure things out, I start disagreeing and customizing. So I figured I'll just create my own opinionated starting kit and find peace.