Grunt HTML5 Boilerplate
Grunt HTML5 Boilerplate is an HTML5 boilerplate with added Grunt task managment functionality. It gives you an easy start to any web project by including the popular Bootstrap Initializr and also adds the workflow power of Grunt to output your code minified and easily organized.
Getting Started
Clone the repo, install node modules and run grunt:
git clone https://github.com/tonyspiro/grunt-html5-boilerplate
cd grunt-html5-boilerplate
npm install
grunt
You can also run this command to watch files for edits:
grunt watch
Grunt will:
- Process your LESS files and minify your CSS into ONE MINIFIED CSS FILE.
- Lint your javascript for issues with JSHint.
- Minify and compile your javascript into ONE MINIFIED JAVACRIPT FILE.
Here is what index.html will look like (notice only one css and and one js file from the dist folder):
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--> <!--<![endif]--> Grunt HTML5 Boilerplate <!-- Les styles --> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> Toggle navigation Project name Sign in <!--/.navbar-collapse --> <!-- Main jumbotron for a primary marketing message or call to action --> Hello, world! This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique. Learn more » <!-- Example row of columns --> Heading Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. View details » Heading Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. View details » Heading Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. View details » © Company 2014 <!-- /container --> <!-- Les scripts --> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
Feel free to fork, add / edit the process and send me feedback.
Find me on twitter @tonyspiro.