Handlebars and Emblem template adapter for Rendr apps.
./app/app.js
module.exports = BaseApp.extend({
defaults: {
templateAdapter: 'rendr-emblem'
},
...
});
Create .emblem files within your ./app/views. You can intermix .hbs and .emblem within the same folder. If the names are the same, the .emblem takes precedence.
-
Install the grunt task grunt-emblem-handlebars
-
Switch out your usual Rendr [handlebars] task with a slightly modified version. This task will pre-compile both Handlebars and Emblem down to a single pre-compiled Handlebars.
-
emblem: { compile: { options: { namespace: false, commonjs: true, processName: function(filename) { var r; r = /(apps\/app\/(templates|views)\/)/; return filename.replace(r, '').replace(/(.emblem|.hbs)/, ''); } }, files: { "tmp/compiledTemplates.js": ["apps/app/views/**/*.emblem", "apps/app/views/**/*.hbs"] }, filter: function(filepath) { var filename; filename = path.basename(filepath); return filename.slice(0, 2) !== "__"; } } }