2.0.2 • Published 7 years ago

hexo-renderer-handlebars v2.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Handlebars renderer plugin for Hexo

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

##Usage

###Install

npm install hexo-renderer-handlebars --save

###Theme Development

Helpers & Partials

If you use handlebars to develop themes, you 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:

var moment = require('moment');

module.exports = function(hexo) {
  return {

    calendarDate: function(date) {
      date = Date.parse(date.toString());
      return moment(date).calendar();
    },

  };
};

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>
2.0.2

7 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago