/Static-Site

Grunt static site generator

Primary LanguageJavaScriptMIT LicenseMIT

Static Site generator

Grunt set-up for static site generation with relative links. The primary purpose of this is to support locally delivered content.

Tasks

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 pages
  • isCurrentPage(url) (Boolean) - Checks if the url is the current page
  • nextPage (Object|undefined) - Next page data if available
  • prevPage (Object|undefined) - Prev page data if available
  • project (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 Gruntfile
  • attributes (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