Content

asimov.js treats content as text files on disk, parsed into a key/value object and a body. Pages are stored under content/, and the path on disk becomes the URL.

content/
home.txt -> /
docs.txt -> /docs
blog/
first-post.txt -> /blog/first-post

File format

Each .txt file is split into a header and a body by the first line that contains ---. The header is parsed as a tiny key/value language (one key per line, key: value); the body is what you reference as {{text}} in templates.

content/home.txt
title: asimov.js
template: home
tags: framework, nodejs, static-site
---
a better toolkit for building
awesome websites and apps

Any key in the header is available to your template by the same name. So {{title}} resolves to “asimov.js”, and {{tags}} is available too. Reserved keys are:

Globals

Files in site/data/ are loaded once at startup and merged into every page’s context. site/data/global.txt is the conventional place to put the site title, author and other shared values:

site/data/global.txt
site_title: asimov.js
author: Adam Renklint
year: 2014

In any template, you can now use {{site_title}} without redeclaring it.

Watch & rebuild

In development, asimov-static watches content/, site/templates/, and site/styles/. Any change re-runs the affected processors and the server reloads, so your edits show up immediately.