Code Monkey home page Code Monkey logo

generator-zf5's Introduction

generator-zf5

Yeoman generator for Zurb Foundation 5.

NPM

Yo Foundation 5!

  • Sass compiling
  • Publishing to dist directory
  • Server with LiveReload (0.0.0.0:9000)
  • Bower install
  • JSHint
  • Font Awesome (option)

Getting Started

$ npm install -g yo

To install generator-zf5 from npm, run:

$ npm install -g generator-zf5

Finally, initiate the generator:

$ yo zf5

Grunt tasks:

..for validating javascript

$ grunt validate-js

..for injecting bower libraries (also in default grunt task)

$ grunt bower-install

..for compiling Sass files

$ grunt compile-sass

..for watching (Sass, Server on 0.0.0.0:9000 with LiveReload)

$ grunt

..for publishing project (dist directory)

$ grunt publish

..for dist directory preview (server on 0.0.0.0:9001)

$ grunt server-dist

LiveReload

For LiveReload call 'grunt' (watching) command and go to http://0.0.0.0:9000

Usemin

Read more about grunt-usemin

Bower-install

Now you can install your libraries much faster. Example:

bower search magnific-popup
...
bower install magnific-popup --save
...
grunt bower-install

This should inject the proper js and css paths into your html files. But you should be careful and check what was injected. 'grunt publish' will then minify and concatenate them into a clean (libraries.min.css and libraries.min.js) files. Instead of a 'bower install' with '--save' you can manualy edit the bower.json file and then run a 'grunt bower-install'. It is also included in the default task - 'grunt'.

Tips

  • if you want you can delete unnecessary/unused Foundation components from main app.scss (it will be lightest main Foundation css file)
  • place all your html files in the root folder (app) or you have to change assets paths (build etc.)
  • try to avoid situation when you have the same build blocks in two html files with different assets so (examples):
<!-- build:js js/mfpopup/mfpopup.min.js -->
    <script src="js/mfpopup/mfpopup.js"></script>
<!-- endbuild -->

and

<!-- build:css css/mfpopup/mfpopup.min.js -->
    <script src="js/mfpopup/mfpopup.js"></script>
    <script src="js/mfpopup/other_script.js"></script>
<!-- endbuild -->

you can add new ones

  • always verify what 'grunt bower-install' injects

You can test it and tell me please if something is not working.

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

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.

License

MIT License

Maybe someone (English speaker) would like to prepare tutorial for zf5 generator? I will be very thankful :)

Contact

@juliancwirko | [email protected]

Changelog

0.6.0 (8.03.2014)

generator-zf5's People

Contributors

jkatsnelson avatar juliancwirko avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.