Is there any way to get render() to execute synchronously? Since render() returns a promise, my helper function returns before the callback has executed.
I have a helper that enables rendering templates from within templates. As long as there are no custom helpers in these nested templates, using Handlebars directly works fine. Including a custom helper in one of these nested templates means I'd need to register that helper with both express-handlebars and Handlebars. This makes things a bit more complex.
Figured out my issue. Hadn't really wrapped my head around the "middleware" concept fully. Your advanced example had what I needed. Just needed to reread it over and over again until it sunk in :)
Is there any way to get
render()
to execute synchronously? Sincerender()
returns a promise, my helper functionreturn
s before the callback has executed.I have a helper that enables rendering templates from within templates. As long as there are no custom helpers in these nested templates, using Handlebars directly works fine. Including a custom helper in one of these nested templates means I'd need to register that helper with both express-handlebars and Handlebars. This makes things a bit more complex.