@nakedcreativity/cee-ms-node 0.3.21 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -160,17 +160,17 @@ function ceems(config) {
|
|
|
160
160
|
render: function(scope, hash){
|
|
161
161
|
// var filepath = Liquid.evalValue(this.match[1]+'.liquid', scope);
|
|
162
162
|
|
|
163
|
-
console.log('look for data collection', this.match[0])
|
|
163
|
+
//console.log('look for data collection', this.match[0])
|
|
164
164
|
|
|
165
165
|
if(site.collections[this.match[0]]){
|
|
166
|
-
console.log(site.collections[this.match[0]]._id)
|
|
166
|
+
//console.log(site.collections[this.match[0]]._id)
|
|
167
167
|
var collection = JSON.parse(fs.readFileSync('./data/'+site.collections[this.match[0]]._id+'.json', 'utf8'));
|
|
168
168
|
|
|
169
169
|
var scopeObj = {}
|
|
170
170
|
scopeObj[this.match[0]] = collection.data
|
|
171
171
|
scope.push(scopeObj)
|
|
172
172
|
|
|
173
|
-
console.log(scope)
|
|
173
|
+
//console.log(scope)
|
|
174
174
|
|
|
175
175
|
return engine.handleCache(this.match[1]+'.liquid')
|
|
176
176
|
.then((templates) => {
|
|
@@ -198,13 +198,20 @@ function ceems(config) {
|
|
|
198
198
|
|
|
199
199
|
})
|
|
200
200
|
|
|
201
|
+
|
|
202
|
+
this.engine.registerFilter('url', (url) => {
|
|
203
|
+
|
|
204
|
+
return this.site.site.url+url
|
|
205
|
+
|
|
206
|
+
})
|
|
207
|
+
|
|
201
208
|
this.engine.registerTag('image', {
|
|
202
209
|
parse: function(tagToken, remainTokens) {
|
|
203
210
|
this.args = tagToken.args.split(' ');
|
|
204
211
|
},
|
|
205
212
|
render: function(scope, hash) {
|
|
206
213
|
var image = Liquid.evalExp(this.args[0], scope);
|
|
207
|
-
console.log(image)
|
|
214
|
+
//console.log(image)
|
|
208
215
|
if(this.args[1] && image.variants && image.variants[this.args[1]]){
|
|
209
216
|
var src = image.variants[this.args[1]]
|
|
210
217
|
}else {
|
|
@@ -221,7 +228,7 @@ function ceems(config) {
|
|
|
221
228
|
},
|
|
222
229
|
render: function(scope, hash) {
|
|
223
230
|
var image = Liquid.evalExp(this.args[0], scope);
|
|
224
|
-
console.log(image)
|
|
231
|
+
//console.log(image)
|
|
225
232
|
if(this.args[1] && image.variants && image.variants[this.args[1]]){
|
|
226
233
|
var src = image.variants[this.args[1]]
|
|
227
234
|
}else {
|