Syntax differences: Sline vs Handlebars

FunctionalityCategoryHandlebarsSline
StringSingle quotesMultiple characters: 'str'Only for single characters: 'a'
Double quotesMultiple characters: "str"Multiple characters: "str"
BackticksNot supportedMultiple characters: `str`
Scope this{{ this.title }}{{ title }}
./{{ ./title }}{{ title }}
../{{ ../title }}Unable to access variables in the parent scope
ExpressionArray indexes{{ products.[0].title }}{{ products[0].title }}
Variable access{{ get key (get index products) }}{{ products[index][key] }}
Comments
  • {{!-- This is a comment --}}
  • {{#comment}} Comments {{/comment}}
{{!-- This is a comment --}}
Extended capabilityHelper
  • Single line: {{ capitalize "test" }}
  • Block: {{#if true}} OK {{/if}}
Use tags or filters instead
TagNot supported
  • Self-closed: {{#component "a" /}}
  • Block: {{#if true}} OK {{/if}}
FilterNot supported{{ "a,b,c" | split(",") | join("-") }}
Was this article helpful to you?