Grunt set-up for static site generation with relative links. The primary purpose of this is to support locally delivered content.
grunt dev
Tasks used for development. Loads into default browser and starts watch task. Will also run unit tests through Jasmine.
grunt build
Compiles into build folder, including minifying JavaScript, CSS and compressing images.
###project.json
JSON file for holding global site data.
##Helpers ###jade
Underscore _
Access to Underscore.js methods
relPath: relPath(to)
Returns the relative path between the page and to
to
(String) - The item to link to
navigation: navigation()
Returns a navigation object for the current page with properties:
pages
(Array) - All available pagesisCurrentPage(url)
(Boolean) - Checks if the url is the current pagenextPage
(Object|undefined) - Next page data if availableprevPage
(Object|undefined) - Prev page data if availableproject
(Object) - The data from the project json file
pageTitle: pageTitle
(String)
The title for this page or undefined if not set.
imageTag: imageTag(src, attributes)
Creates an image tag with width and height (for local images) taken from the image
src
(String) - The src of the image. Automatically looks in the images directory set in Gruntfileattributes
(Object) - Object containing key/value pairs of HTML attributes. Setting width and height will overwrite the automatic values
###Browserify JavaScript files are dynamically added to Browserify's task through useBrowserify blocks defined in the HTML.
Example:
<!-- [use:browserify] -->
<script src='shared/js/foo.js'></script>
<!-- [end] -->
##Preprocessors
##Dependencies
- Grunt
- grunt-browserify
- grunt-concurrent
- grunt-contrib-clean
- grunt-contrib-compass
- grunt-contrib-compress
- grunt-contrib-connect
- grunt-contrib-copy
- grunt-contrib-imagemin
- grunt-contrib-jade
- grunt-contrib-jasmine
- grunt-contrib-jshint
- grunt-contrib-uglify
- grunt-contrib-watch
- image-size
- jshint-stylish
- load-grunt-tasks
- lodash
- underscore.string