grunt-bliss
v0.0.2
Published
Compile Bliss templates.
Downloads
4
Readme
grunt-bliss
Compile Bliss templates.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-bliss --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-bliss');
Bliss task
Run this task with the grunt bliss
command.
Configuration
bliss: {
options: {
data: {
day: 10,
year: 2001
}
},
compile: {
files: {
'tmp/bliss.html': ['test/fixtures/bliss.js.html']
},
options: {
data: {
year: 2013
}
}
}
}
Related template (bliss.js.html):
@!(data)
@{
products = [{
name: "foo",
price: 123
},{
name: "bar",
price: 123
}]
}
<ul>
<div>
@[email protected]
</div>
@for(var p=0; p<products.length; p++) {
@{ product = products[p] }
<li>@product.name: ([email protected])</li>
}
</ul>
Output:
<ul>
<div>2013-10</div>
<li>foo: ($123)</li>
<li>bar: ($123)</li>
</ul>