Blot

Get started

If you have experience developing templates on other platforms, Blot’s approach will be familiar. You should be comfortable working with HTML and CSS.

Make your first edit

Go to your site’s dashboard and click Edit template then click Edit code.

What is in a template?

A Blot template is made of a configuration file and a set of template views. Typical template files are:

  • package.json — Template configuration: locals (template-wide variables for all views), views (per-file routing via url and per-view partials). If you’re unsure which view maps to which URL, check views[*].url in package.json.
  • entries.html - (homepage)
  • entry.html - Single post
  • archives.html - Archives
  • style.css — Main stylesheet (plain CSS).
  • script.js — Optional client-side behavior (plain JavaScript).

When more than one view’s url matches a request, Blot picks the most specific, as nginx does. Exact URLs such as /archives or /style.css come first. Then URLs with named parameters such as /tagged/:tag, with more literal path segments (then more literal characters) first. Wildcards such as /{*path} come last, again with the longest literal prefix first. If two are equally specific, the view whose file name sorts first wins.

Template language

Template files are rendered using Mustache regardless of the file extension.

Edit templates locally

Go to your site’s dashboard and click Edit template then click Edit code then Move to folder.

Blot will create the following subdirectory:

/Templates/TemplateName

Blot will automatically build the template from the files placed in this directory. Do not create subdirectories for view files. Keep view files in the template root. Avoid view-name collisions: don’t create two views with the same basename (e.g. feed.xml and feed.rss).

You can download a ZIP file of the template’s source files from the web template editor. Click on Duplicate then Download ZIP.

Edit and test loop

Use ?json=true on any page to inspect the exact JSON context used for rendering. Make a change, reload the page and verify HTML output and CSS/JS asset URLs.

Becoming proficient

After you have browsed the developer documentation, consider duplicating a copy of one of Blot’s templates and reading its source code. Keep changes minimal and backwards-compatible, prefer semantic HTML and accessible patterns and keep client JS optional so the site degrades gracefully if JS is disabled. When adding a new view or route, update package.json and link it from the template’s navigation where appropriate.