Skip to content

spaceribs/hexo-renderer-handlebars

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handlebars renderer plugin for Hexo

With this plugin you can use the handlebars to render theme. For Hexo 2.x

##Usage

###Install

npm install hexo-renderer-handlebars --save

###Theme Development

Helpers & Partials

If you use handlebars to develop themes, may need to customize helpers. You can create a folder named helper in the theme root, then exports all helpers to an javascript object in index.js.

For example:

.
├── languages
└── layout
	└── partials
		└── footer.hbs
└── helper
	└── index.js

index.js:

module.exports = {
  foo: function() { return 'foo.'; },
  bar: function() { return 'bar.'; }
};

For partials, put them in a partials function under the layout, and you will be able to use them normally.

footer.hbs:

<div>{{theme.author}} Something down here</div>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%