Documentation
This section covers everything needed to build, customize, and deploy static sites with Tola. If you are new, start with Overview and Quick start. To look up configuration fields or package signatures directly, go to Reference.
01 Start Install the binary, initialize your first site, and learn daily CLI and editor workflows. 02 Concepts Build pipeline, Typst web authoring, route mapping, and metadata schemas. 03 Guides Navigation, Typst authoring and queries, assets and styles, data, feeds, and deploy. 04 Extend Modules and themes, authoring extensions, multi-stage hooks, Nushell, and build performance. 05 Reference
tola.toml tables, @tola/* package signatures, and @tola-scripts/* options.Start
- Overview: How Tola builds a static site from a single Typst entry program and how the build workflow fits together.
- Installation: Install Tola via install script, prebuilt archive, Cargo, or Nix Flake and verify your local setup.
- Quick start: Initialize a site from an empty directory, start live preview, then add metadata, a shared layout, and styles.
- CLI: Daily dev, check, inspect, and format commands, plus editor LSP and Nushell integration.
Concepts
- Build model: Source discovery, hook stages, Typst Bundle compilation, whole-site verification, and atomic publishing.
- Typst basics: Core Typst syntax for writing content, component functions, layouts, HTML elements, and math in a Tola site.
- Routing: Understand source paths, site routes, output paths, and browser URLs, plus slugs, permalinks, and base-path.
- Metadata: Declare page metadata with tola-meta and validate fields, types, and cross-field rules with @tola/schema.
Guides
- Layouts: Build a shared HTML shell, dispatch templates by page kind, and drive the whole site from one published page list.
- Table of contents: Generate nested tables of contents with headings() from @tola/document, assign stable ASCII anchor IDs, and add heading permalinks.
- Trees & breadcrumbs: Build a multi-level doc tree from path segments, support virtual parent directories, validate sibling order, and render sidebars and breadcrumbs.
- Neighbors & pagination: Compute previous/next links with adjacent, window, and tree reading order, and slice blog archives into paginated routes.
- Tags & archives: Group posts by tag, category, and year with @tola/collection, guard against slug collisions, and emit collection index pages.
- Backlinks: Collect incoming links across the Bundle with references() from @tola/document and compute multi-hop reachability or orphans with @tola/datalog.
- Multilingual sites: Organize locale directories and URL prefixes, map translations, localize body links, and fall back gracefully when translations are missing.
- Queries: Understand Bundle-wide query(), state, and counter scope, narrow introspection to one document, aggregate shared assets, and compare with tola query.
- Math & diagrams: Choose between native MathML and html.frame SVGs for math, wrap CeTZ, Fletcher, and Mermaid diagrams, and adapt colors for dark mode.
- Footnotes & citations: Handle endnotes and wide-screen sidenotes in HTML export, isolate per-page counters, and configure .bib and Hayagriva bibliographies.
- PDF output: Compile one .typ source into both HTML and a downloadable PDF using target(), while isolating paged layout rules.
- Code blocks: Dual light/dark syntax highlighting with @tola/code, line highlights and diff markers, language dispatch, and custom syntaxes.
- Static assets: Declare static files and cache busting, separate compiler fonts from web fonts, and generate responsive images with @tola/image.
- Styles & icons: Serve plain CSS, use the official Tailwind CSS v4 module or custom hooks, and manage SVG icon sets with @tola/icon.
- Search: Emit a lightweight search JSON index at compile time or integrate external static search indexers via generate-outputs hooks.
- Dark mode: Wire a flicker-free theme toggle, emit standalone SVGs with query, compute WCAG balanced grey ink, and weigh dual SVGs vs light-dark().
- Scripts: Manage browser JavaScript by size and scope: serve native ES modules, inline first-paint snippets, or bundle TypeScript with hooks.
- External data: Parse and validate JSON/TOML/YAML/CSV data into generated pages, inject hook data via before-build, and emit non-HTML files with asset().
- SEO & feeds: Emit canonical links, Open Graph and Twitter cards, RSS/Atom/JSON feeds, and sitemaps using @tola/head, @tola/feed, and @tola/sitemap.
- Deploy: Verify outputs and subpaths before launch, lock and vendor dependencies for offline builds, and deploy from CI to static hosts.
- 404 & redirects: Generate a custom 404.html page and preserve legacy URLs with static redirect pages or platform redirect rules.
- Diagnostics: Report custom metadata checks, accessibility rules, and content conventions during Typst compilation with report() from @tola/diagnostic.
Extend
- Modules: Register modules from local paths, Git, or tarballs, use the official tailwind and resize-images modules, and customize themes without editing their source.
- Authoring modules: Build Typst component modules and full themes with option bindings, assets, fonts, named queries with LSP, commands, initializers, and packing.
- Hooks: Attach Nu scripts or external executables before compilation, during output assembly, and after publish, with dev reuse caching and diagnostics.
- Nushell scripts: Write site scripts and hooks using Tola's embedded Nushell runtime, built-in libraries, @tola-scripts tools, and interactive pickers.
- Performance: Understand single-Bundle incremental bounds and speed up dev reloads and full builds via hook reuse, narrowed watches, and leaner templates.
Reference
- Reference: Online reference hub, offline tola help lookup and JSON export, and tola skill guides.
- Configuration: All tola.toml tables, keys, defaults, and examples.
- Built-in packages: Signatures, parameters, and examples for the @tola/* Typst packages.
- Built-in scripts: Commands and options for the @tola-scripts/* Nushell tools.