Skip to main content

Templates

A template is an HTML file with placeholders for variables. Brightspot’s templates are based on Handlebars.

The following snippet is an example of a simple template.

showLineNumbers {6,10,12,15,18}
1
<!DOCTYPE html>
2
<html>
3
4
<head>
5
<meta charset="UTF-8">
6
<title>{{headline}}</title>
7
</head>
8
9
<body>
10
<div>
11
<div>
12
<h1>{{headline}}</h1>
13
</div>
14
<div>
15
{{body}}
16
</div>
17
<div>
18
<img src="{{imageUrl}}" height="300">
19
</div>
20
<div>
21
</body>
22
23
</html>
  • 6. Declares a title tag, the value of which is a variable headline. (Literals in {{double braces}} are placeholders for dynamic content.)
  • 10. Opens an empty <div> tag.
  • 12. Declares an h1 tag, the value of which is a variable headline.
  • 15. Declares a placeholder for the article’s variable body.
  • 18. Declares an image tag, the source of which is a variable URL.