Skip to content

Commit

Permalink
Update helper.md (hexojs#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrienko authored and yoshinorin committed Apr 21, 2019
1 parent 7a8f0e7 commit b0aad09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/api/helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ hexo.extend.helper.register('js', function(path){
### Where to place custom helper?

Place it under `themes/<yourtheme>/scripts`

### How do I use another registered helper inside my custom helper?

`hexo.extend.helper.get` will return the helper function, but it needs to have hexo as its context, so:

``` js
const url_for = hexo.extend.helper.get('url_for').bind(hexo);
```

0 comments on commit b0aad09

Please sign in to comment.