Documentation
Everything Lattice reads from disk, and what it writes back.
Configuration
lattice.config.mjs exports a single object. Only collections
is required; the rest has defaults that suit a small site.
export default {
outDir: 'dist',
collections: {
notes: { dir: 'content/notes', layout: 'note.njk' },
docs: { dir: 'content/docs', layout: 'doc.njk' },
},
markdown: { smartypants: true, footnotes: true },
};
Collections
A collection maps a directory to a route prefix. Each file's front matter is
validated against the collection schema; a missing title or an
unparsable date fails the build rather than the deploy.
| Field | Type | Notes |
|---|---|---|
title | string | Required. Used in the index and the <title> tag. |
date | date | Optional. Sorts the index; ISO 8601 preferred. |
tags | string[] | Optional. Drives the tag index and related lists. |
draft | boolean | Optional. Drafts build locally, never in production. |
Routes
File paths map to URLs directly, with two exceptions: index.md
becomes the directory index, and a leading _ excludes the file from
the build entirely (useful for shared partials).
Deployment
The output directory is self-contained. Upload it to any static host; asset filenames are content-hashed, so they can be cached forever while HTML keeps a short max-age.
Command reference
| Command | Effect |
|---|---|
lattice build | Full build into outDir. |
lattice build --changed | Rebuild only pages whose inputs changed. |
lattice serve | Local server with live reload on port 4321. |
lattice check | Validate front matter and internal links without writing. |