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.

FieldTypeNotes
titlestringRequired. Used in the index and the <title> tag.
datedateOptional. Sorts the index; ISO 8601 preferred.
tagsstring[]Optional. Drives the tag index and related lists.
draftbooleanOptional. 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

CommandEffect
lattice buildFull build into outDir.
lattice build --changedRebuild only pages whose inputs changed.
lattice serveLocal server with live reload on port 4321.
lattice checkValidate front matter and internal links without writing.