Open de-vo-id opened 2 months ago
Hi @de-vo-id , I'm so sorry i missed this earlier! Thank you for taking the time to right it up.
I can't think of reason not to add this. it seems very straight forward.
@Lanjelin , you have more Handlebars experience, am I missing something here, or I go ahead and put it in the next release?
Description
Hello! I found your plugin earlier, and have been enjoying it a lot. However, I've ran into a bit of a roadblock with my recipe template. I wanted to specify a sort of "or" or "any" conditional statement in order to only create a nutrition category if those values are available from the recipe website. Since a helper like that isn't built into Handlebars and a custom one isn't provided (and using a bunch of nested if statements isn't my jam) I very quickly came up with my own and shoved it into the main.js plugin file. It's been working very well for me, but it would be awesome to see it included in the plugin by default.
Plugin code
I'm quite a noob with JS and TS so these might be a bad way of doing it or prone to breaking everything. Likely can be refined.
The helper function (for the compiled main.js):
The helper function (for main.ts):
Handlebars template usage
How I've used it:
There's a chance that all of this is completely useless and I'm an idiot for missing something that's already built-in. If not, then I'd love for you to consider adding it!