mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-25 01:40:10 +00:00
Introduce "either" helper for Handlebars themes.
This commit is contained in:
parent
e908e8bb34
commit
b0bc71cd66
@ -49,6 +49,12 @@ Template helper definitions for Handlebars.
|
|||||||
return txt && txt.trim() ? _.initial( txt.split(' ') ).join(' ') : '';
|
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:
|
// Set up a generic conditional helper so we can do:
|
||||||
// {{compare val otherVal operator="<"}}
|
// {{compare val otherVal operator="<"}}
|
||||||
// http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/
|
// http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/
|
||||||
|
Loading…
Reference in New Issue
Block a user