Templates

Templates are plain HTML files with .tmpl extension under site/templates/. They use a small mustache-flavoured syntax for substitution and partial imports — no logic-heavy DSL, on purpose.

site/templates/home.tmpl
{{import "header"}}
<div class="wrapper center">
<h1 class="logo"><strong>asimov</strong>.js</h1>
<p class="content">{{text}}</p>
</div>
{{import "footer"}}

Syntax

TagMeaning
{{key}}Render the value of key from the page context (frontmatter + globals).
{{import "name"}}Inline another template by file name (without .tmpl).
{{style "main"}}Inject a <link> to a compiled stylesheet (see Stylesheets).
{{link "url" "label"}}Render an <a href="url">label</a> — a helper.

Anything inside {{ }} that isn’t recognised as a helper or import is treated as a key lookup. Unknown keys render empty.

Picking a template

If a content file declares template: docs, asimov-static will look for site/templates/docs.tmpl. Otherwise it falls back to page.tmpl. There is no template inheritance — instead, you compose with {{import}} for shared headers, footers, sidebars, and menus.

Conventions

These partial names appear in nearly every asimov.js project, and most plugins look for them by convention:

You can override any of them in your project — project templates win over plugin templates.