Skip to content

Commit

Permalink
Fix: missing doc for abeEditor variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Nov 28, 2016
1 parent 1f9172b commit 1a1a175
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
15 changes: 15 additions & 0 deletions 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}}
```
12 changes: 6 additions & 6 deletions src/cli/cms/templates/handlebars/setVariable.js
Expand Up @@ -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
}

0 comments on commit 1a1a175

Please sign in to comment.