#Getting started
This project requires:
- node and npm
brew install node
- grunt-cli
npm install -g grunt-cli
Install node dependencies:
npm install
Install bower dependencies:
bower install
To run a grunt build:
grunt
To start a webserver and watch for file changes::
grunt serve
Then open http://0.0.0.0:8000 in your web browser
The project uses Grunt to build assemble the html, minify and concatenate the assets into the public
folder. The main grunt tasks are:
grunt
: runs an entire build from scratch, running all grunt tasks and compiling the flat site into thepublic
directorygrunt watch
: watches for changes to files, and runs tasks relating to the file changes
grunt assemble
: Compiles the HTML from handlebars into flat HTML, placing the files in thepublic
directorygrunt jshint
: runs jshint on javascript files before any concat and uglify tasksgrunt concat
: Copies assets from bower_components into the public site structuregrunt uglify
: Minifies all javascript in thepublic
directorygrunt modernizr
: scans the CSS/Javascript files looking for any references to modernizr tests, and generates a custom build using the tests foundgrunt less
: Compiles the source LESS files into CSS, placing them in thepublic
directorygrunt cssmin
: Minifies all the CSS in thepublic
directory
The flat HTML is built from handlebar templates. This makes use of page templates and partials. The include/html
directory can be used as a reference for how the pages are constructed.
layouts
: These are the outer page layouts. The master.hbs includes elements that are on every page. The rest are sub-layouts, such as the default layout, or a full width layout. These sub-layouts are compiled into the master template.pages
: Each file represents a flat HTML file that will be copied into the public directory. At the top of this file variables are set for the compiler, such as page template and page titlepartials
: These are HTML modules that are reused across page templates. Things like the header, footer and sub-navigation live in this directory