shannonmoeller / gulp-hb

A sane Gulp plugin to compile Handlebars templates. Useful as a static site generator.
http://npm.im/gulp-hb
MIT License
147 stars 14 forks source link

Custom partial helper #56

Closed alxbenz closed 6 years ago

alxbenz commented 6 years ago

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?

shannonmoeller commented 6 years ago

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.