Guides
Task-focused guides for building sites with Tola, organized by topic.
Navigation
Layouts, table of contents, sidebar trees and breadcrumbs, pagination, taxonomies, backlinks, and i18n.
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.
Typst
Document queries, math and diagrams, footnotes and citations, PDF output, and code blocks.
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.
Frontend
Static assets and images, CSS and icons, site search, dark mode, and client scripts.
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.
Publishing
External data and assets, SEO and feeds, 404s and redirects, custom diagnostics, and deploy.
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.