[modules]
Attach local, Git, or tarball modules under site-chosen aliases.
Declare each module under [modules.<alias>]. Multiple aliases may point to the same module source with independent options. Every module directory contains a tola-module.toml manifest.
Module sources
Choose exactly one source per alias:
path: Local directory (relative to the site root, or absolute when allowed by the input scope; must stay inside the site under--pureand outsidebuild.publish-dir).git:{ url = "...", tag | branch | rev = "...", subdir = "..." }. Supportshttps://,ssh://, andgit@host:path. Uses your local Git credential helper or SSH configuration; credentials are never written totola.lock.tarball:{ url = "https://..." }or{ path = "..." }, with optional 64-hexsha256. Supports.tar.gz,.tar.zst, and ZIP archives containing one top-level directory withtola-module.toml.
Run tola update <alias> after changing a source or to update locked commits; run tola vendor --refresh when vendoring. Input flags control resolution: --locked keeps tola.lock unchanged while allowing downloads, --offline forbids network access, and --pure restricts builds to in-site sources and vendored copies.
Entry, libraries, options, assets, and hooks
- Set
[build] entry = { module = "<alias>" }to use a module’s site entry. Import its public Typst library from@tola-modules/<alias>:0.0.0, and read its runtime handle with@tola/module#get-module. - Override manifest defaults under
[modules.<alias>.options]: nested tables merge key by key; arrays and scalars replace. - Module static assets publish under
/_tola-modules/<alias>/(withsite.base-pathprepended). Disable all assets for an instance with[modules.<alias>.assets] enable = false, or replace enabled files from the site root. - Module hooks run in the same three build stages as site hooks (see
[hooks]). Inside module manifests,{name},{module},{project}, and{tola}expand in arguments and paths;{ project = "..." }inrerun-onwatches site files.
Module commands, guides, and initializers
- Modules may expose author commands (
[commands.<name>]intola-module.toml, invoked astola <alias> <command>), built-in guides (skill = "GUIDE.md"), and site initializers ([init], invoked viatola init <dir> --from <source> --alias <alias>). - Run
tola module packandtola module checkwhen preparing a module for distribution.
Examples
Configure the official Tailwind module and a local theme with options
[modules.theme]
path = "theme"
[modules.theme.options]
title = "Field Notes"
[modules.tailwind]
git = { url = "https://github.com/tola-rs/modules.git", subdir = "tailwind" }