Sukr: A minimal static site compiler in Rust with zero-JS output

28 points by nrdxp


Sukr is a minimal static site compiler written in Rust that focuses on moving traditionally client-side features to build-time. It uses Tree-sitter for syntax highlighting (with language injection support), KaTeX for MathML rendering, and Mermaid for inline SVG diagrams. The resulting static HTML contains zero bytes of JavaScript.

nrdxp

I built sukr because I wanted a static site generator that didn't just punt modern features (math, diagrams, highlighting) to the browser. Most SSGs require a heavy JavaScript runtime for these, but I wanted to see how far I could get with an "Interceptor Pipeline" architecture that handles everything at build-time.

Some technical highlights:

The compiler is written in Rust (2024 edition) and uses pulldown-cmark for the event stream. Happy to hear feedback on the "interceptor" pattern I used to swap out markdown events for highlighted spans and SVGs. Project link: https://github.com/nrdxp/sukr

dmbaturin

Regarding https://sukr.io/comparison.html — do Zola and Hugo have built-in features that produce JS output and cannot work without client-side JS?