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}}!
{{content}}
This should link to Aral’s homepage.
This should link to the Modern iOS Development workshop.
This should be Aral’s headshot:
{{name}} knows {{skills}}.
No friends found.
{{/if}}<h1>{{title}}</h1>
<p>Hello from {{name}}!<p>
<p>{{content}}</p>
<p><a href='{{newURL}}'>This should link to Aral’s homepage.</a></p>
<p><a href='http://{{correctURLFragment}}.com'>This should link to the Modern iOS Development workshop.</a></p>
<p>This should be Aral’s headshot:</p>
<img src='{{aralImageURL}}'>
<h2>Friends and their skills</h2>
{{#if friends}}
<ul class='friends-list'>
{{#each friends}}
<li>
<p>{{name}} knows {{skills}}.</p>
</li>
{{/each}}
</ul>
{{else}}
<p class='no-friends-warning'>No friends found.</p>
{{/if}}
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: 'moderniosdevelopment'
aralImageURL: 'http://aralbalkan.com/images/aral.jpg'
friends:
[
{name: 'Laura', skills: 'design, development, illustration, speaking'},
{name: 'Seb', skills: 'particles, games, JavaScript, C++'},
{name: 'Natalie', skills: 'HTML, CSS'}
]
exports.route = (request, response) ->
response.render 'simple', data