0.2.0 • Published 8 years ago

grunt-static-hbs v0.2.0

Weekly downloads
5
License
Zlib
Repository
github
Last release
8 years ago

Static HBS

NPM version

Installation

$ npm install grunt-static-hbs
grunt.loadNpmTasks ("grunt-static-hbs");

Quick Start

"hbs":
{
	target1:
	{
		options:
		{
			layout: "path/to/layout.html",

			helpers:
			{
				"helper1": "path/to/helper.js",
				"helper2": function (...) { }
			},

			partials:
			{
				"partial1": "path/to/partial.html",
				"partial2": "some inline partial"
			}
		},

		files:
		{
			"result1.html": "path/to/source.html",

			"result2.html":
			{
				 source: "path/to/source.html",
				 layout: "path/to/layout.html",
				context: "path/to/context.json"
			},

			"result3.html":
			{
				 source: "path/to/source.html",
				context: { some: "context" }
			}
		}
	},

	target2:
	{
		...
	}
}

Documentation

Options

  • layout A path to your layout file.
  • helpers An object containing helpers specified as a path to a module exposing a function or a function.
  • partials An object containing partials specified as a path to a partial or a string representing a partial.

Files

"path/to/result.html": "path/to/source.html"
  • source A path to your input file. Attempts to use "path/to/source.json" as a context.
"path/to/result.html": { additional options }
  • source A path to your input file.
  • layout A path to your layout file, overriding layout specified in options.
  • context A context, either as a path to a json file or an inline object.

Author