Skip to content

themeleon/themeleon-handlebars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Themeleon Handlebars

Handlebars mixin for Themeleon.

Warning: this repository/package is deprecated, template engines will be handled by consolidate.js in Themeleon 3.0.

Installation

In your package.json:

{
  "dependencies": {
    "themeleon": "1.*",
    "themeleon-handlebars": "1.*"
  }
}

Usage

Say we have the following theme structure:

views/
  foo/
    bar.handlebars
  foo.handlebars
  index.handlebars
var themeleon = require('themeleon')();

// Use the Handlebars mixin
themeleon.use('handlebars');

// Or inject your own instance
themeleon.use('handlebars', require('handlebars'));

module.exports = themeleon(__dirname, function (t) {
  // Render index alone
  t.handlebars('views/index.handlebars', 'index.html');

  // Or include a partials object
  t.handlebars('views/index.handlebars', 'index.html', {
    foo: 'views/foo.handlebars',
    'foo/bar': 'views/foo/bar.handlebars',
  });

  // Or let the mixin resolve all `.handlebars` files in `views`
  // Note: `.handlebars` and `.hbs` extensions are supported.
  t.handlebars('views/index.handlebars', 'index.html', 'views');
});

About

[DEPRECATED] Handlebars mixin for Themeleon.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published