A Yeoman generator that creates a basic site template with grunt setup ready for development and distribution.
Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things. If you'd like to get to know Yeoman better and meet some of his friends, Grunt and Bower, check out the complete Getting Started Guide.
Some of the following code may need a 'sudo' before it to work depending on your setup.
gem install sass
Install Node.js from http://nodejs.org/
#Try this if you get some package errorsnpm cache clean#Followed bynpm update
npm install -g bower
Install the Grunt CLI (Command line interface)
npm install -g grunt-cli
npm install -g yo
(See above for all the )
To install generator-start-site, run:
npm install -g generator-start-site#Lots of code will happen... This is npm installing what it needs
When you want to create a new site simply run:
Answer the questions and Yeoman will sort you out!
Grunt lives in the tasks folder. Navigate to this folder and run (Stop grunt watch running using cmd + c):
#ignore this if your in the 'tasks' folder alreadycd /yourproject/tasks/#rungrunt watch
Your HTML templates and css/scss live in the dev folder. Any changes you make to the 'dev/src/scss' files will be compiled into the 'dev/static/css' folder. you can make as many HTML file as you need in the dev folder - they will all be copied to the dist folder when you're ready to go live!
Once your site is ready to go live you will need to run:
#ignore this if your in the 'tasks' folder alreadycd /yourproject/tasks/#rungrunt dist
Grunt will process all your sass, minify and copy it, concatonate and minify your js to the header and footer scripts (pre & post) and copy and html files across to the dist folder. You can the FTP or copy your dist folder to where ever you want. It's all self contained.
In the included index.html you will see:
<!-- build:js static/js/pre.js --><script src="static/js/header.js"></script><script src="bower_components/modernizr/modernizr.js"></script><!-- endbuild -->