grunt-ect-templates
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "grunt-ect-templates", | ||
"description": "Static site compiler built around ect", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/shuvalov-anton/grunt-ect", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -44,2 +44,12 @@ # grunt-ect | ||
grunt ect | ||
grunt ect | ||
## Special object '__' | ||
I need it that I can generate CSS classes by file basename. | ||
* `<%= @__.basename %>` — contains file basename. | ||
* `<%= @__.filename %>` — contains file name. | ||
@@ -20,2 +20,3 @@ 'use strict'; | ||
var variables = data.variables || {}; | ||
variables.__ = {}; // Special data. | ||
var ect = new ECT(options || {}); | ||
@@ -30,2 +31,3 @@ | ||
for (var key in files) { | ||
@@ -35,2 +37,6 @@ if (files.hasOwnProperty(key)) { | ||
// export basename to template | ||
variables.__.filename = path.basename(file); | ||
variables.__.basename = path.basename(file, '.ect'); | ||
// src && dst are absolute path to ect source and ect dst | ||
@@ -37,0 +43,0 @@ var src = path.resolve(cwd, file); |
9042
88
55