1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-12-27 23:37:22 +00:00

Introduce "either" helper for Handlebars themes.

This commit is contained in:
hacksalot 2015-12-18 13:00:47 -05:00
parent e908e8bb34
commit b0bc71cd66

View File

@ -49,6 +49,12 @@ Template helper definitions for Handlebars.
return txt && txt.trim() ? _.initial( txt.split(' ') ).join(' ') : '';
});
// Set up a Markdown-to-WordProcessingML helper so we can do:
// {{either A B}}
HANDLEBARS.registerHelper("either", function( lhs, rhs, options ) {
if (lhs || rhs) return options.fn(this);
});
// Set up a generic conditional helper so we can do:
// {{compare val otherVal operator="<"}}
// http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/