Zero-dep static site generator written in Rust. I originally built it to learn Rust, now it's my playground for testing AI coding tools. It regenerates everything on each build (no caching), but still stupid fast thanks to Rust. Includes built-in ramdisk support so I don't wear out my SSD.
It powers my real websites:
- Partial TypeScript support:
.tsassets are stripped of types and minified to.js(interfaces, simple generics, casts, and type annotations removed). - Partial SCSS support: local
@use/@importare inlined and simple nesting flattened; variables and mixins are not supported. - Generates
.jsonfiles alongside.htmlpages (content/title/css) to enable client-side routing. - Minifies HTML, JS, and CSS.
- Parses
.jsonfiles undersites/<site>/data/and exposes them to templates viadata.*variables (e.g.,data.navigation.0.name). - Partial Liquid support:
include,assign(withwherefilter),for(withlimit,forloopvars likefirst,last,index,index0,length),if,unless, and basic{{ variable }}replacement.
To run the website locally, make sure you have the following installed:
- Git
- Rust
To get the website running on your local machine, follow these steps:
git clone https://github.com/hngrhorace/my-static-websites.git
cd my-static-websitesmake setupThis will install git hooks, build the project, and set up everything you need for development.
Alternative manual setup:
./scripts/setup-hooks.sh # Install git hooks
cargo build # Build the projectcargo run generate <site_name>This will generate the static files for the specified site. The site content should be located in ./sites/<site_name>/.
Example:
cargo run generate polgarand.org# Basic watch mode
cargo run watch <site_name>
# Watch mode with RAM-based output (Linux only)
cargo run watch <site_name> --ramdiskThis starts watching your site's directory for changes and automatically regenerates the site when files are modified.
The --ramdisk flag enables storing generated files in RAM instead of on disk, which can help prevent SSD wear during development. This feature is only available on Linux systems and will automatically fall back to regular disk storage on other operating systems.
cargo run serveThis starts a local development server to preview your generated site.
Each site should be organized in the following structure under ./sites/<site_name>/:
└── your-site-name/
├── posts/ # Blog posts (Markdown files)
├── pages/ # Static pages (Markdown files)
├── includes/ # Template includes (Liquid files)
├── layouts/ # Page layouts (HTML templates)
└── style.css # Site stylesheet
The generated output will be placed in the ./out/ directory.