lattice is a MoonBit static site generator built for the 2026 MoonBit Software Synthesis Challenge (SCC).
The project goal is structural integrity: content contract violations should fail the build, not appear later as runtime surprises.
Content integrity is treated as a structural property of the build pipeline:
- typed frontmatter schemas
- validated wikilinks against a full site index
- schema-enforced content collections and data files
In lattice, these are build-time failures:
- missing required frontmatter fields
- frontmatter type mismatches
- broken wikilink targets
- invalid template slots/data-slot paths
- collection and data-schema configuration errors
Build the project:
moon buildRun a build with defaults (./content → ./dist, config at ./content/lattice.conf):
moon run cmd/main -- buildRun a build with explicit content/output directories:
moon run cmd/main -- build ./content ./distRun a build with config and collections overrides:
moon run cmd/main -- build ./content ./dist --config ./example/site.cfg --collections ./example/collections.cfgRun structural checks only (no output writes):
moon run cmd/main -- check ./content ./distRun in polling watch mode for local development:
moon run cmd/main -- build ./content ./dist --watchAdjust the polling interval if needed:
moon run cmd/main -- build ./content ./dist --watch --watch-interval 1000Start the dev server with live reload:
moon run cmd/main -- serve ./content ./dist --port 4321lattice uses subcommands powered by @clap:
lattice build [content-dir] [output-dir] [options] — build the site
lattice check [content-dir] [output-dir] [options] — validate/lint only
lattice serve [content-dir] [output-dir] [options] — dev server + live reload
| Flag | Subcommands | Description |
|---|---|---|
-c, --config <path> |
build, check, serve | Override site config file |
--collections <path> |
build, check, serve | Override collections config file |
--drafts |
build, serve | Include draft posts |
--watch |
build | Rebuild on file changes with polling |
--watch-interval <ms> |
build | Polling interval (default: 500) |
--force |
build | Ignore incremental cache |
-p, --port <N> |
serve | HTTP port for dev server (default: 4321) |
Defaults: content-dir → ./content, config → <content-dir>/lattice.conf, output-dir → config.output_dir or ./dist.
assets: static file validation/copy with typed copy errors.builder: two-pass orchestration (collect/index, then validate/render/emit).collections: parser for typed collection and data-schema definitions.config: site config parser with typed parse/validation errors.data: typed data-file loader and schema validation for template data slots.frontmatter: frontmatter parser to typedFrontmatterValuetrees.graph: shared typed page graph structures for downstream emitters.highlight: syntax tokenization/highlighting for fenced code blocks.html: HTML document emitters from typed metadata.lint: typed violation model and formatting for check mode.markdown: markdown parser/renderer with diagnostics.pagination: typed pagination model for index-like pages.rss: Atom feed rendering from typed page graph input.schema: schema ADTs and frontmatter validation.search: JSON search index rendering.shortcode: shortcode parsing/rendering with typed params/errors.sitemap: sitemap XML rendering.slug: deterministic slug/path normalization helpers.tags: typed tag extraction from frontmatter with automatic tag index and per-tag page generation.template: template slot parser/renderer with typed slot and data-path checks.wikilink: wikilink extraction/resolution against page index.
The example/ directory is a compact feature demo site:
- content:
example/content/ - templates:
example/templates/ - static assets:
example/content/static/ - config:
example/site.cfg - notes:
example/README.md
Run it with:
moon run cmd/main -- build ./example/content ./example/dist --config ./example/site.cfgFor local preview, start the dev server:
moon run cmd/main -- serve ./example/content ./example/dist --config ./example/site.cfgOr pair --watch with a static file server such as simple-http-server:
simple-http-server ./distFrom repo root:
moon build