@nakedcreativity/cee-ms-node 0.3.12 → 0.3.13
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 +31 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -166,6 +166,37 @@ function ceems(config) {
|
|
|
166
166
|
}
|
|
167
167
|
})
|
|
168
168
|
|
|
169
|
+
this.engine.registerTag('breadcrumb', {
|
|
170
|
+
parse: function(tagToken, remainTokens) {
|
|
171
|
+
this.template = tagToken.args
|
|
172
|
+
},
|
|
173
|
+
render: function(scope, hash){
|
|
174
|
+
|
|
175
|
+
var breadcrumbArray = []
|
|
176
|
+
var path = ''
|
|
177
|
+
scope.scopes[0].path.forEach(handle => {
|
|
178
|
+
path += handle
|
|
179
|
+
if(site.pages[path]){
|
|
180
|
+
breadcrumbArray.push(site.pages[path])
|
|
181
|
+
path += '/'
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
scope.push({
|
|
186
|
+
breadcrumb: breadcrumbArray
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
return engine.handleCache(this.template+'.liquid')
|
|
190
|
+
.then((templates) => {
|
|
191
|
+
return engine.renderer.renderTemplates(templates, scope);
|
|
192
|
+
})
|
|
193
|
+
.then((html) => {
|
|
194
|
+
scope.pop();
|
|
195
|
+
return html;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
|
|
169
200
|
this.engine.registerTag('blog', {
|
|
170
201
|
parse: function(tagToken, remainTokens) {
|
|
171
202
|
this.match = tagToken.args.split(' ')
|