In essence, Blot is a static file server. It serves your folder to your readers. When a request from one of your readers arrives at your blog, Blot follows these steps to work out what to send in response.
When a request from one of your readers arrives at your blog, Blot follows these steps to work out what to send in response.
Blot shows the blog post instead of the file. This is because Blot routes requests from your readers to your blog’s template first. If you prefer, you can disable your blog’s template on the dashboard and just use Blot as a static file server.
Blot’s templates are written in 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="{{{url}}}">{{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.