A blazingly fast static site generator for your blog, written in Rust.
- Scaffolding: Quickly initialize a new blog project.
- Content Management: Create new articles and categories with simple commands.
- Static Site Generation: Build your entire site into a
builddirectory. - Live Preview: A built-in server to preview your site locally.
- Pure Themes: Themes are deterministic WebAssembly components that render pages.
- Lifecycle Plugins: WASI Preview 2 plugins run sequential hooks around rendering.
- Search: Built-in multilingual, fuzzy search powered by Tantivy.
Ensure you have Rust and Cargo installed. Then, you can install Thought from the source:
cargo install --path .-
Initialize a new blog:
thought init my-awesome-blog cd my-awesome-blog -
Create a new article:
thought new "My First Article" -
Create a new category:
thought category guides new "Helpful Guides" -
Create an article within a category:
thought new --category guides "A Helpful Guide" -
Generate your site:
thought generate
Your static site will be generated in the
builddirectory. -
Serve your site locally:
thought serve
Your site will be available at
http://127.0.0.1:2006.
thought init <name>: Creates a new blog workspace.thought new <name> [--category <category>]: Creates a new article.thought category <category> new <name>: Creates a new category.thought generate [--output <path>]: Generates the static site.thought serve [--port <port>]: Serves the generated site.thought clean: Removes thebuilddirectory.thought search "<query>": Rebuilds the search index and performs a fuzzy, multilingual search through your articles.
Running thought generate emits a browser bundle under assets/thought-search/ (a WebAssembly payload plus thought-search.js). Themes can include the helper script via Article::search_script_path() (or index_search_script_path() on the index), then call window.ThoughtSearch.search("<query>") to fetch ranked matches without reimplementing indexing logic.
The main configuration for your blog is in the Thought.toml file. Here you can set the title of your blog, the owner, and the theme to use.
title = "My Awesome Blog"
owner = "Your Name"
template = "zenflow"Thought distinguishes between themes and plugins so you can scale presentation and behaviour independently.
- Themes are compiled to WebAssembly components (the
theme-runtimeworld). They expose pure functions such asgenerate_pageandgenerate_index, receive article data, and must return HTML. A theme cannot perform I/O, read clocks, or mutate shared state; the host instantiates it for every render to guarantee determinism and parallelism. You can find the built-inzenflowtheme underthemes/zenflow. - Plugins target WASI Preview 2 (
lifecycle-runtime) and execute sequential lifecycle hooks (on_pre_render,on_post_render). Plugins may perform side effects such as reading cached data, writing to/build, or using time and randomness. They are evaluated in declaration order, so the output of one plugin becomes the input of the next.
When building custom behaviour, choose a theme whenever you only need to transform data into HTML, and reach for a plugin when you need stateful coordination or side effects.