| Crates.io | tola |
| lib.rs | tola |
| version | 0.6.5 |
| created_at | 2025-06-18 07:50:12.850584+00 |
| updated_at | 2025-12-28 05:36:45.823185+00 |
| description | static site generator for typst-based blog - keeping your focus on the content |
| homepage | https://github.com/kawayww/tola-ssg |
| repository | https://github.com/kawayww/tola-ssg |
| max_upload_size | |
| id | 1716731 |
| size | 696,546 |
A static site generator for Typst-based blogs.
Yeah, my blog is alos built with
tola.
When a template or shared file changes, tola uses its in-memory dependency graph to determine the minimal rebuild set:
DependencyGraph
├── forward: content.typ → {template.typ, utils/a.typ, ...}
└── reverse: template.typ → {page1.typ, page2.typ, ...}
This ensures that editing a utility function used by 5 pages only rebuilds those 5 pages, not the entire site.
tola from any subdirectory; it finds tola.toml automaticallyfeed.xml from page metadatasitemap.xml for search enginesKeep your focus on the content itself.
tola is built around three core principles:
tola provides a thin layer over Typst — just enough to handle the boring stuff (routing, live reload, local server, incremental rebuild smartly) without locking you into a rigid framework. Your Typst code stays portable.
If Typst can do something easily, use Typst. tola doesn't reinvent the wheel — it leverages Typst's powerful markup and scripting capabilities.
tola init <SITE-NAME> gets you running in secondscargo install tola
Download from the release page.
A flake.nix is provided in the repo. Pre-built binaries are available at tola.cachix.org.
Step 1: Add tola as an input in your flake.nix:
{
inputs = {
tola.url = "github:tola-ssg/tola-ssg/v0.6.5";
# ...
};
}
Step 2: Configure cachix in your configuration.nix:
{ config, pkgs, inputs, ... }:
{
nix.settings = {
substituters = [ "https://tola.cachix.org" ];
trusted-public-keys = [ "tola.cachix.org-1:5hMwVpNfWcOlq0MyYuU9QOoNr6bRcRzXBMt/Ua2NbgA=" ];
};
environment.systemPackages = [
# 1. Native build (recommended if you want to build from source)
# inputs.tola.packages.${pkgs.system}.default
# 2. Pre-built binaries (recommended for fast CI/CD)
# Choose the one matching your system:
inputs.tola.packages.${pkgs.system}.aarch64-darwin # macOS (Apple Silicon)
# inputs.tola.packages.${pkgs.system}.x86_64-linux # Linux (x86_64)
# inputs.tola.packages.${pkgs.system}.aarch64-linux # Linux (ARM64)
# inputs.tola.packages.${pkgs.system}.x86_64-windows # Windows (x86_64)
# 3. Static Binaries (Linux only)
# inputs.tola.packages.${pkgs.system}.x86_64-linux-static
# inputs.tola.packages.${pkgs.system}.aarch64-linux-static
];
}
Note: The
defaultpackage builds natively for your system. If a pre-built binary is not available in the cache fordefault, Nix will build it from source. The specific architecture packages (e.g.,aarch64-darwin) are explicit cross-compilation targets that are likely populated in the cache.
A static site generator for typst-based blog
Usage: tola [OPTIONS] <COMMAND>
Commands:
init Init a template site
build Deletes the output directory if there is one and rebuilds the site
serve Serve the site. Rebuild and reload on change automatically
deploy Deletes the output directory if there is one and rebuilds the site
help Print this message or the help of the given subcommand(s)
Options:
-o, --output <OUTPUT> Output directory path (relative to project root)
-c, --content <CONTENT> Content directory path (relative to project root)
-a, --assets <ASSETS> Assets directory path (relative to project root)
-C, --config <CONFIG> Config file name [default: tola.toml]
-h, --help Print help
-V, --version Print version
Build/Serve Options:
--base-url <URL> Override base URL for deployment (e.g., GitHub Pages)
--clean Clean output directory before building
-m, --minify Minify HTML output
-t, --tailwind Enable Tailwind CSS processing
--rss Enable RSS feed generation
--sitemap Enable sitemap generation
You can run tola from any subdirectory — it will automatically find tola.toml by searching upward.
.
├── assets/
│ ├── fonts/
│ ├── images/
│ ├── scripts/
│ └── styles/
├── content/
│ ├── posts/
│ ├── index.typ
│ └── about.typ
├── templates/ # Dependency directory (triggers dependent rebuilds)
│ └── base.typ
├── utils/ # Dependency directory (triggers dependent rebuilds)
│ └── helpers.typ
└── tola.toml
Files under content/ are mapped to their respective routes:
| Source Path | URL |
|---|---|
content/index.typ |
/index.html |
content/about.typ |
/about/ |
content/posts/hello.typ |
/posts/hello/ |
# Create a new site
tola init my-blog
cd my-blog
# Build for production
tola build
# Start development server
tola serve
⚠️ Early development & experimental HTML export
tola is usable but evolving — expect breaking changes and rough edges. Feedback and contributions are welcome!
Typst's HTML output is not yet as mature as its PDF output. Some features require workarounds:
<span style="white-space: pre-wrap"> between inline elements to preserve spacing (PR #6750)These are upstream limitations in Typst itself, not tola. As Typst's HTML backend matures, these rough edges will smooth out.
Coming soon!
In the meantime:
tola --help and tola <command> --help for CLI usageMIT