March Docs

SiteConfig

Loads optional sigil.toml project config and merges it over the built-in defaults. Precedence (low -> high): defaults < sigil.toml < CLI flags. This module only seeds the defaults from the config file; CLI flag overriding happens afterwards in Ssg.parse_flags.

Schema (flat [section] tables, double-quoted string values): [site] title = "My Site" base_url = "https://example.com" [build] content_dir = "content" output_dir = "out" static_dir = "static"

Missing/unreadable file -> silently returns the unchanged defaults.

IMPLEMENTATION NOTE: this is a deliberately small line-based parser rather than the stdlib Toml module. Toml.parse produces a nested TomlValue whose compiled (Perceus) manipulation is currently miscompiled — every shape we tried failed natively: reading the value with Toml.get_in more than once aborts with an RC underflow (each getter consumes the value), a single hand-walk that binds TTable(inner)/TStr(val) comes back empty, and threading a multi-field accumulator drops trailing fields. A flat line scan that only threads Strings and binds plain tuples (the same shape as Page.decode / FrontMatter.split, which compile correctly) sidesteps all of those compiler bugs.

Functions

fndefault_pathdefault_path() : String do "sigil.toml" end#
fnloadload(path : String, def_content : String, def_output : String,#