diff --git a/docs/abe-handlebars-variables.md b/docs/abe-handlebars-variables.md new file mode 100755 index 00000000..7e7caa39 --- /dev/null +++ b/docs/abe-handlebars-variables.md @@ -0,0 +1,15 @@ +# Abe handlebars Variable + +> Abe admin is rendered with handlebar engine, global variables are added inside template rendering + +# Editor + +When on the admin edit view `abeEditor` is set to `true` otherwise set to `false` + +```html +{{#if abeEditor}} + Html rendered inside post when user edit the post +{{else}} + Html rendered when user "publish" the post (final output) +{{/if}} +``` \ No newline at end of file diff --git a/src/cli/cms/templates/handlebars/setVariable.js b/src/cli/cms/templates/handlebars/setVariable.js index fdb98c59..41124588 100644 --- a/src/cli/cms/templates/handlebars/setVariable.js +++ b/src/cli/cms/templates/handlebars/setVariable.js @@ -3,11 +3,11 @@ * Handlebars helper, to add variable inside template file */ export default function setVariable(varName, varValue, options){ - if (varValue === "true") { - varValue = true - } - if (varValue === "false") { - varValue = false - } + if (varValue === 'true') { + varValue = true + } + if (varValue === 'false') { + varValue = false + } options.data.root[varName] = varValue } \ No newline at end of file