私のassemblefile.jsでカスタムヘルパーを登録しようとしています。ヘルパー自体は、私がそれをアセンブルして不平等なプロジェクトで使用しているので動作します。アセンブルでカスタムハンドヘルドヘルパーを登録する方法0.17.1
assemble: {
options: {
helpers: ['./src/helper/custom-helper.js' ]
}
}
アセンブルでは、このように試しましたが、うまくいきませんでした。誰もこれを行う方法を知っていますか?
app.helpers('./src/helper/custom-helper.js');
カスタムhelper.js:あなたがそれらを登録される、組み立てとヘルパーを登録するための.helper
と.helpers
メソッドを使用できるように
module.exports.register = function (Handlebars, options, params) {
Handlebars.registerHelper('section', function(name, options) {
if (!this.sections) {
this.sections = {};
}
this.sections[name] = options.fn(this);
return null;;
});
};
ありがとうございました。できます!!! – Majabee