Handlebars example

This is the same template but for Handlebars. The template is not pure HTML and is not suitable to design in the browser with.


Hello from {{name}}!


This should link to Aral’s homepage.

This should link to Ind.ie

This should be Aral’s headshot:

Friends and their skills

{{#if friends}}
    {{#each friends}}
  • {{name}} knows {{skills}}.

  • {{/each}}

No friends found.



<p>Hello from {{name}}!<p>


<p><a href='{{newURL}}'>This should link to Aral&rsquo;s homepage.</a></p>

<p><a href='http://{{correctURLFragment}}.com'>This should link to Ind.ie.</a></p>

<p>This should be Aral&rsquo;s headshot:</p>

<img src='{{aralImageURL}}'>

<h2>Friends and their skills</h2>

{{#if friends}}
<ul class='friends-list'>
  {{#each friends}}
    <p>{{name}} knows {{skills}}.</p>
<p class='no-friends-warning'>No friends found.</p>


data =
  title: 'Express 3‐Handlebars sample'
  name: 'Express 3‐Handlebars'
  content: 'This is a simple example to demonstrate Express 3‐Handlebars'
  newURL: 'http://aralbalkan.com'
  correctURLFragment: 'ind'
  aralImageURL: 'http://aralbalkan.com/images/aral.jpg'
    {name: 'Laura', skills: 'design, development, illustration, speaking'},
    {name: 'Jo', skills: 'operations, cognitive psychology, sports coaching'},
    {name: 'Osky', skills: 'begging for food, looking cute, occasionally howling'}

Express 3 router (node.js)

exports.route = (request, response) ->
  response.render 'simple', data