/usr/bin/bash
script to quickly setup a project using html5boilerplate and
twitter bootstrap.
This script is a 1-2-3 application able to create a new H5BP project folder in few seconds using the latest versions of H5BP, H5BP Ant build script and Twitter's Bootscrap.
Based upon mklab's "h5bp + twitter bootstrap integration" script idea: https://gist.github.com/1422879 . It's not a fork, even if it uses the same CSS custom files. I've created this script as the mklab's one was messing with the already-created repository clones... and 'cause I love creating BASH scripts :)
I am new to the HTML5 Boilerplate & CSS/LESS frameworks & etc. I started just reading an article on a web magazine. Even though I have to learn loads of new stuff, I'm in the BASH playground by a while. This script allows you to easily grab the latest H5BP, H5BP Ant Build script and Bootstrap versions using GIT.
Unlike the original script, this doesn't need Node.js, even though it will require the lessc in the PATH env variable in order to pre-compile the Bootscrap's (and your) LESS css (i.e. lessc correctly installed).
A custom H5BP basic setup including Bootscrap, ready to be used without any further edit by the web developer.
→ .repo
| → ant-build-script
| → bootstrap
| → h5bp
→ <project folder>
| → build
| | → config
| | → tools
| → css
| | → less
The .repo folder contains the git repository clones of the various projects, while the project folder can be moved safely. It is suggested to run the script always in the same directory in order to use again the same repository clones.
- Clone / update the HTML5 Boilderplate repository in
.repo/h5bp
- Clone / update the HTML5 ant build script in
.repo/ant-build-script
- Clone / update the Twitter's Bootstrap repository in
.repo/bootsrtap
- Create the temp folder
.repo/combined
and copy the H5BP and H5BP build script files - Execute the build script's createproject.sh creating the
./<project folder>
, then delete the temp folder.repo/combined
- Copy the Bootstrap's LESS files into
./<project folder>/css/less
- Rename the H5BP's
style.css
toh5bp.css
, createapp.css
(the one to edit), then mix the Bootstrap's, H5BP's and project's stylesheets into./<project folder>/css/style.css
- Concatenate the Bootstrap's jQuery plugins into
./<project folder>/js/plugins.js
, automatic and interactive step (note: a hack is required to concatenate the popover plugin as last one, as it requires tooltip first. NEED A BETTER SOLUTION) - Compile the Bootstrap's less stylesheet and save it as
./<project folder>/css/bootstrap.css
First time only:
chmod +x h5bp-bootstrap.sh
Then:
./h5bp-bootstrap.sh project_name
A project_name folder will appear, and it will be ready for work (you can move it wherever you want). Use the Bootstrap's classes and plugins as you wish, edit css/style.css
only if you want to add other CSS files (with @import
), use css/app.css
as your main stylesheet file. The build script includes the bootstrap's installation by default.
Do not use whitespace in the project name (mandatory), and if possible run the script in a directory with no spaces too (should be fine though). Suggestions are appreciated.