grunt-facebookhtml
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "grunt-facebookhtml", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "", | ||
"license": "ISC", | ||
"readme": "ERROR: No README data found!", | ||
"_id": "grunt-facebookhtml@0.0.2", | ||
"_from": "grunt-facebookhtml@~0.0.1", | ||
"_id": "grunt-facebookhtml@0.0.4", | ||
"_from": "grunt-facebookhtml@0.0.4", | ||
"dependencies": { | ||
"handlebars": "~2.0.0-alpha.4" | ||
} | ||
}, | ||
"dist": { | ||
"shasum": "65cdca86825baf6ed0d4b686d158d5709b46f379", | ||
"tarball": "http://registry.npmjs.org/grunt-facebookhtml/-/grunt-facebookhtml-0.0.2.tgz" | ||
}, | ||
"_npmVersion": "1.3.21", | ||
"_npmUser": { | ||
"name": "speaktosteve", | ||
"email": "speaktosteve@gmail.com" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "speaktosteve", | ||
"email": "speaktosteve6@gmail.com" | ||
} | ||
], | ||
"directories": {}, | ||
"_shasum": "52844b3b620e77162cdbfa8763c5103a8d7ed766", | ||
"_resolved": "https://registry.npmjs.org/grunt-facebookhtml/-/grunt-facebookhtml-0.0.4.tgz", | ||
"readme": "ERROR: No README data found!", | ||
"scripts": {} | ||
} |
@@ -8,3 +8,2 @@ var Handlebars = require('handlebars'); | ||
grunt.registerMultiTask('facebookhtml', 'generates static files for facebook links',function(target){ | ||
var done = this.async(); | ||
@@ -20,2 +19,3 @@ | ||
destFolder = this.files[0].dest, | ||
env = this.env, | ||
template, | ||
@@ -25,6 +25,8 @@ data = [], | ||
for(helper in options.helpers){ | ||
Handlebars.registerHelper(helper, options.helpers[helper]); | ||
} | ||
Object.keys(options.helpers).forEach(function(helper){ | ||
Handlebars.registerHelper(helper, options.helpers[helper]); | ||
}); | ||
function generateTemplates(){ | ||
@@ -39,3 +41,4 @@ data.forEach(generateTemplate); | ||
var output = template(item), | ||
outputfile = path.join(destFolder, item.id + '.html'); | ||
outputfile = path.join(destFolder, item.id + '.' + options.env + '.html'); | ||
grunt.log.writeln('output: ' + item.id + '.' + options.env + '.html'); | ||
fs.writeFileSync(outputfile, output, {encoding:'utf8'}); | ||
@@ -42,0 +45,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2885
47