expose as a helper to be used from templates

This commit is contained in:
Kevin Ngo 2017-06-25 16:25:18 -07:00
parent a144d00ed0
commit 9295e5f7ff
2 changed files with 37 additions and 17 deletions

View file

@ -1,6 +1,6 @@
# hexo-filter-github-emojis
[![Npm Version](https://img.shields.io/npm/v/hexo-filter-github-emojis.svg)](https://npmjs.org/package/hexo-filter-github-emojis)
[![Npm Version](https://img.shields.io/npm/v/hexo-filter-github-emojis.svg)](https://npmjs.org/package/hexo-filter-github-emojis)
[![Npm Downloads Month](https://img.shields.io/npm/dm/hexo-filter-github-emojis.svg)](https://npmjs.org/package/hexo-filter-github-emojis)
[![Npm Downloads Total](https://img.shields.io/npm/dt/hexo-filter-github-emojis.svg)](https://npmjs.org/package/hexo-filter-github-emojis)
[![License](https://img.shields.io/npm/l/hexo-filter-github-emojis.svg)](https://npmjs.org/package/hexo-filter-github-emojis)
@ -60,7 +60,7 @@ The filter will try to download the latest version of [Github Emojis][ghemojis]
- **localEmojis** - You can specify your own list. An object or JSON string is valid. The filter will first check the `localEmojis` then fallback to the [Github Emojis][ghemojis] list.
For example:
```yaml
githubEmojis:
localEmojis:
@ -79,4 +79,12 @@ The filter will try to download the latest version of [Github Emojis][ghemojis]
arrow_right: https://path/to/arrow_right.png
```
## Helper
You can also render a GitHub emoji from a template using the `github_emoji` helper:
```html
<h1><% github_emoji('octocat') %></h1>
```
[ghemojis]: https://api.github.com/emojis