|
18 | 18 | plutils = require('./utilities'), |
19 | 19 | patternEngines = require('./pattern_engines/pattern_engines'); |
20 | 20 |
|
21 | | - var config = fs.readJSONSync('./config.json'); |
22 | | - |
23 | 21 | function setState(pattern, patternlab){ |
24 | 22 | if(patternlab.config.patternStates && patternlab.config.patternStates[pattern.patternName]){ |
25 | 23 | pattern.patternState = patternlab.config.patternStates[pattern.patternName]; |
|
56 | 54 | // if we've been passed a full oPattern, it knows what kind of template it |
57 | 55 | // is, and how to render itself, so we just call its render method |
58 | 56 | if (pattern instanceof of.oPattern) { |
59 | | - if (config.debug) { |
60 | | - console.log('rendering full oPattern: ' + pattern.name); |
61 | | - } |
62 | 57 | return pattern.render(data, partials); |
63 | 58 | } else { |
64 | 59 | // otherwise, assume it's a plain mustache template string and act |
65 | 60 | // accordingly |
66 | | - if (config.debug) { |
67 | | - console.log('rendering plain mustache string:', pattern.substring(0, 20) + '...'); |
68 | | - } |
69 | 61 | return patternEngines.mustache.renderPattern(pattern, data, partials); |
70 | 62 | } |
71 | 63 | } |
|
76 | 68 | var filename = path.basename(file); |
77 | 69 | var ext = path.extname(filename); |
78 | 70 |
|
79 | | - if (config.debug) { |
80 | | - console.log('processPatternIterative:', filename); |
81 | | - } |
82 | | - |
83 | 71 | // skip non-pattern files |
84 | 72 | if (!patternEngines.isPatternFile(filename, patternlab)) { return null; } |
85 | 73 |
|
|
0 commit comments