include
Split site configuration across multiple local TOML files.
Place include at the top of tola.toml before the first [table] header. Each entry is either a path string or a table { path = "...", optional = true }.
Load order and paths
- Relative paths in
includeresolve from the directory of the file that declares them. Site-relative settings inside included files (such asbuild.publish-diror a local module’spath) still resolve from the site root. - Entries must be literal local file paths. Globs, environment variables, and remote URLs are not expanded. Absolute paths follow the active input scope (for example,
--purerequires every configuration file to stay inside the site). - Missing files fail unless marked
optional = true. Present files are always validated regardless ofoptional. - Files apply in array order, depth-first: each file’s own
includelist runs before the file itself, andtola.tomlapplies last before defaults fill remaining keys. - Including the same file more than once applies it each time (which also repeats hooks and assets and can trigger duplicate names or output paths). Cycles are rejected.
Merge rules
Tables merge key by key. Later scalars and ordinary arrays replace earlier values. Asset and hook arrays (assets.files, assets.trees, hooks.before-build, hooks.generate-outputs, hooks.after-publish) append in load order.
| Written later | Result |
|---|---|
| Omit a key | Keep the earlier value. |
title = "" | Replace with an empty string (when allowed by that field). |
languages = [] under [site] | Replace earlier entries with an empty list. |
files = [] under [assets] | Append zero entries; earlier declarations remain. |
| An empty table | Keep all keys already set in that table. |
Use tola inspect config --json --pretty to inspect config_sources (load order and optional-missing files) and field_origins (which file set or overrode each key).
Examples
Share a base file with optional local overrides
include = [
"config/base.toml",
{ path = "config/local.toml", optional = true },
]