grunt-bake
Advanced tools
Comparing version 0.3.8 to 0.3.9
{ | ||
"name": "grunt-bake", | ||
"description": "Bake external includes into files to create static pages with no server-side compilation time", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"homepage": "https://github.com/MathiasPaumgarten/grunt-bake", | ||
@@ -32,3 +32,3 @@ "author": { | ||
"dependencies": { | ||
"mout": "~0.7.1" | ||
"mout": "~0.9.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -281,3 +281,3 @@ # grunt-bake [![Build Status](https://travis-ci.org/MathiasPaumgarten/grunt-bake.png?branch=master)](https://travis-ci.org/MathiasPaumgarten/grunt-bake) | ||
The __bake__ task also allows a simple `if` conditional. Inline attributes named `_if` are treated as such. If the value that `_if` holds can't be found in the content.json or if found equals to the value `false` the include will be ignored. | ||
The __bake__ task also allows a simple `if` conditional. Inline attributes named `_if` are treated as such. If the value that `_if` holds can't be found in the content.json or if found equals to the value `false` the include will be ignored. The `_if` can also be used inverted to create a `_else` effect in a way. A definition as `_if="!name"` would mean the template will be rendered when `name` cannot be found or is `false`. | ||
@@ -284,0 +284,0 @@ _app/base.html_: |
@@ -117,4 +117,16 @@ /* | ||
function hasValue( name, values ) { | ||
name = name.replace( / /g, "" ); | ||
var invert = false; | ||
if ( name[ 0 ] === "!" ) { | ||
name = name.substr( 1 ); | ||
invert = true; | ||
} | ||
var current = mout.object.get( values, name ); | ||
return current === false || current === undefined ? false : true; | ||
var returnValue = current === false || current === undefined ? false : true; | ||
return invert ? ! returnValue : returnValue; | ||
} | ||
@@ -121,0 +133,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31124
483
+ Addedmout@0.9.1(transitive)
- Removedmout@0.7.1(transitive)
Updatedmout@~0.9.0