Overview

Tola is a static site generator built on Typst. One Typst entry program (defaulting to site.typ) controls the entire site: source discovery, metadata validation, route mapping, templates, and data aggregation all live in the same language.

Site entry

In Tola, the entry program compiles as a single Typst Bundle and decides which output files are produced. This site.typ declares a home page and an about page directly:

typst
#let shell(body) = html.main(class: "page", body)

#document("index.html", format: "html", title: "Home")[
  #shell[
    #title[Hello, Tola]

    See #link("/about/")[About].
  ]
]

#document("about/index.html", format: "html", title: "About")[
  #shell[
    #title[About]

    $ integral_0^infinity e^(-x^2) dif x = sqrt(pi)/2 $
  ]
]

Running tola build writes index.html and about/index.html into the publish directory (defaulting to public/), serving routes / and /about/.

As a site grows, move page content into content/, scan it with all-sources() in site.typ, and #include each source into a template. Because the entire site compiles in one context, tables of contents, cross-document links, backlinks, and link checking work natively without regex post-processing or external plugins.

Workflow

Tola site workflow:Author config, content, and templates, preview with dev, verify with check, and emit HTML, PDFs, feeds, and assets with build. Tola site workflow:Author config, content, and templates, preview with dev, verify with check, and emit HTML, PDFs, feeds, and assets with build.
  • Semantic HTML and native math: = Headings, #link(...), lists, and tables export to standard HTML elements; inline and display equations export to native MathML with no client-side JavaScript:

    ∫0∞𝑒−𝑥2d𝑥=𝜋2
  • Whole-site verification: Before writing public/, Tola merges Bundle outputs, static assets, and hook outputs, then checks path uniqueness, internal links, asset references, and page fragments.

  • Bundled toolchain: One binary ships pinned versions of Typst and Nushell, so helper scripts, image resizing, and diagnostics behave identically on macOS, Linux, and Windows.

  • Modular extensions: Directories containing tola-module.toml can package component libraries, themes, named queries, CLI subcommands, and initializers; tailwind and resize-images are built in.

Reading order

Search this site

Use the arrow keys to move through results.

Type to search.