hrh
hexo-renderer-handlebars
npm i hexo-renderer-handlebars
hrh

hexo-renderer-handlebars

Handlebars renderer plugin for Hexo.

by Jared Forsyth

2.0.2 (see all)License:{"type":"MIT","url":"https://raw.github.com/jaredly/hexo-renderer-handlebars/master/LICENSE"}TypeScript:Not Found
npm i hexo-renderer-handlebars
Readme

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>

Downloads/wk

89

GitHub Stars

25

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

5

OPEN ISSUES

4

OPEN PRs

1
VersionTagPublished
2.0.2
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate