shannonmoeller / gulp-hb

A sane Gulp plugin to compile Handlebars templates. Useful as a static site generator.

Home Page:http://npm.im/gulp-hb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom partial helper

alxbenz opened this issue · comments

Hi,

I want to create a custom partial helper.
e.g. {{include partialanme}} instead of {{> partialname}}

Is there a way to reference the partials from within the helper function?

Yep! Under the hood, gulp-hb uses the handlebars-wax library. It supports a pattern where you export a factory inside your custom helpers or partials files. The factory method will receive the handlebars instance as an argument. That's how handlebarts-layouts does it.