Rendr Data Adapter to handle emblem templates
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
node_modules
server
shared
test
.gitignore
.npmignore
README.md
index.js
package.json

README.md

rendr-emblem v0.0.1

Getting Started

Handlebars and Emblem template adapter for Rendr apps.

Usage

1) Set the default templateAdapter to rendr-emblem

./app/app.js

    module.exports = BaseApp.extend({
        defaults: {
            templateAdapter: 'rendr-emblem'
        },
        
        ...
    });

2) Create emblem files

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.

3) Add grunt task

  • 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) !== "__";
        }
      }
    }