Mustache. Consider this example template, which produces a list of all of the posts on your blog:
<html>
<title>{{title}}</title>
<body>
{{#all_posts}}
<a href="">{{title}}</a><br>
{{/all_posts}}
</body>
</html>
Blot generates JSON containing the data for this template:
{ "title": "Your blog's title", "all_posts": [ {"title": "First post", "url": "/first-post"}, {"title": "Second post", "url": "/second-post"}, {"title": "Third post", "url": "/third-post"} ] }
Blot then renders the template to produce this HTML:
<html>
<title>Your blog's title</title>
<body>
<a href="/first-post">First post</a><br>
<a href="/second-post">Second post</a><br>
<a href="/third-post">Third post</a><br>
</body>
</html>
If you append the query string ?debug=true
to the URL of any page on your blog, you can see the JSON used to render its template.
Remember that your blog’s folder behaves like a static file server. This makes it possible to share assets between your templates.
You can create your own metadata. There’s no configuration neccessary. Just choose a property that isn’t already used by Blot, like Author
for example:
Author: Eric Blair Metadata keys should be a single word. They are case insensitive
Once the property exists in a file, you can use it in your template:
<html>
<title>{{title}}</title>
<body>
{{#entry}}
<p>Posted by {{metadata.author}}</p>
...
{{/entry}}
</body>
</html>