-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Helpers like partials are a nearly ubiquitous concept among tempting engines. Just like partials it would be nice to be able to express a path in the view config:
views: {
engines: { html: 'handlebars' },
path: __dirname + '/templates',
partialsPath: __dirname + '/templates/withPartials',
helpersPath: __dirname + '/templates/helpers'
} Currently I achieve the desired functionality by:
var Hapi = require('hapi'),
handlebars = require('handlebars'),
loader = require('node-glob-loader');
// Load View Helpers
loader.load('./application/views/helpers/*.js', function (exports) {
exports(handlebars);
});With the config: views.engine.module = handelbars.
And the helpers following the form:
module.exports = function (handlebars) {
handlebars.registerHelper('foo', function () {
return 'bar';
});
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement