buttons
Version:
How many ways are there to build a button with Assemble? Many.
17 lines • 443 B
JavaScript
/**
* Duplicate the content in the encapsulated block n times.
* @param {Number} n [Number of times to duplicate content.]
* @example
* {{#repeat '10'}}
* {{> button }}
* {{/repeat}}
*/
module.exports.register = function(Handlebars, options) {
Handlebars.registerHelper('repeat', function(n, context) {
var times = '';
for (var i = 0; i < n; ++i) {
times += context.fn(this);
}
return times;
});
};