templates
Advanced tools
Comparing version 0.10.4 to 0.10.5
@@ -59,3 +59,3 @@ 'use strict'; | ||
app.asyncHelper(options.plural, function listHelper(context, cb) { | ||
if (typeof context.fn !== 'function') { | ||
if (typeof context === 'string') { | ||
createdHelper.apply(this, arguments); | ||
@@ -65,3 +65,10 @@ return; | ||
var ctx = new List(collection); | ||
cb(null, context.fn(ctx)); | ||
// render block helper with list as context | ||
if (typeof context.fn === 'function') { | ||
cb(null, context.fn(ctx)); | ||
return; | ||
} | ||
// return list when not used as a block helper | ||
cb(null, ctx); | ||
}); | ||
@@ -68,0 +75,0 @@ |
@@ -455,9 +455,9 @@ 'use strict'; | ||
item.data.pager.index = items.length; | ||
item.data.pager.current = item; | ||
utils.define(item.data.pager, 'current', item); | ||
if (items.length) { | ||
var prev = items[items.length - 1]; | ||
item.data.pager.prev = prev; | ||
prev.data.pager.next = item; | ||
utils.define(item.data.pager, 'prev', prev); | ||
utils.define(prev.data.pager, 'next', item); | ||
} | ||
} |
{ | ||
"name": "templates", | ||
"description": "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"homepage": "https://github.com/jonschlinkert/templates", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
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
119751
3176