Comparing version 0.6.3 to 0.7.0
@@ -59,2 +59,6 @@ "use strict"; | ||
registerIfNeHelper(); | ||
registerIfGtHelper(); | ||
registerIfGeHelper(); | ||
registerIfLtHelper(); | ||
registerIfLeHelper(); | ||
injectGlobalsToHelpers(globals); | ||
@@ -306,2 +310,74 @@ clearDistributionDirectoryIfNeeded(); | ||
} | ||
/** If greater than Block helper | ||
* @example | ||
* {{#if_gt var N }} | ||
* var > N | ||
* {{else}} | ||
* var < N | ||
* {{/if_gt}} | ||
*/ | ||
function registerIfGtHelper() { | ||
handlebars_1.default.registerHelper('if_gt', function (a, b, options) { | ||
if (a > b) { | ||
return options.fn(this); | ||
} | ||
else { | ||
return options.inverse(this); | ||
} | ||
}); | ||
} | ||
/** If greater or equal than Block helper | ||
* @example | ||
* {{#if_ge var N }} | ||
* var >= N | ||
* {{else}} | ||
* var <= N | ||
* {{/if_ge}} | ||
*/ | ||
function registerIfGeHelper() { | ||
handlebars_1.default.registerHelper('if_ge', function (a, b, options) { | ||
if (a >= b) { | ||
return options.fn(this); | ||
} | ||
else { | ||
return options.inverse(this); | ||
} | ||
}); | ||
} | ||
/** If less than Block helper | ||
* @example | ||
* {{#if_lt var N }} | ||
* var < N | ||
* {{else}} | ||
* var > N | ||
* {{/if_lt}} | ||
*/ | ||
function registerIfLtHelper() { | ||
handlebars_1.default.registerHelper('if_lt', function (a, b, options) { | ||
if (a < b) { | ||
return options.fn(this); | ||
} | ||
else { | ||
return options.inverse(this); | ||
} | ||
}); | ||
} | ||
/** If less or equal than Block helper | ||
* @example | ||
* {{#if_le var N }} | ||
* var <= N | ||
* {{else}} | ||
* var >= N | ||
* {{/if_le}} | ||
*/ | ||
function registerIfLeHelper() { | ||
handlebars_1.default.registerHelper('if_le', function (a, b, options) { | ||
if (a <= b) { | ||
return options.fn(this); | ||
} | ||
else { | ||
return options.inverse(this); | ||
} | ||
}); | ||
} | ||
function scanSourceFiles() { | ||
@@ -308,0 +384,0 @@ const allSourceFiles = filesystem.scanFiles(configuration_1.default.getSourceDirectoryPath(), false, true, true); |
{ | ||
"name": "symply", | ||
"version": "0.6.3", | ||
"version": "0.7.0", | ||
"description": "A simple static site generator.", | ||
@@ -5,0 +5,0 @@ "author": "Oleg Legun <oleg.legun@gmail.com>", |
197610
1714