Site mode is the programmatic way to use MoPress: instead of relying exclusively on configuration files, you express build rules and pipelines directly in MoonBit code via an embedded DSL. Inspired by Hakyll's composable compiler philosophy, Site mode decomposes static site generation into fine-grained functional steps that can be freely combined.
Creating general static websites (blogs, portfolios, product landing pages) rather than strictly documentation books.
Applying different pipelines to different subsets of files.
Injecting native in-process MoonBit logic, data transformations, and custom AST walks.
Harnessing the power and safety of functional programming.
Item[T]: The data container flowing through pipelines, carrying typed payloadT, route destination, and template variables.Step: A function of shape
(Item[T]) -> Item[R]that transforms data.Rule: Declarative binding of Glob patterns to Handlers.Pipeline: An execution graph of Steps connected via MoonBit's pipe operator|>.
Getting Started with Site Mode: Creating your first
site.mbtxscript.Rules, Handlers, and Steps: Core concepts and lifecycle.
Composing Steps: Built-in steps and composition patterns.
Output Formats: Documents, assets, and data emission.