Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaredly/hexo-renderer-handlebars
https://github.com/jaredly/hexo-renderer-handlebars
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaredly/hexo-renderer-handlebars
- Owner: jaredly
- License: mit
- Created: 2014-07-31T07:53:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T14:07:43.000Z (over 7 years ago)
- Last Synced: 2024-04-14T00:50:51.357Z (7 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 26
- Watchers: 6
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[Handlebars](http://handlebarsjs.com) renderer plugin for [Hexo](http://zespia.tw/hexo)
====================================
> With this plugin you can use the [handlebars](http://handlebarsjs.com/) to render your theme. For Hexo 3.x##Usage
###Install
``` bash
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`:
``` javascript
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`:
``` handlebars
{{theme.author}} Something down here
```