A developer shares lessons learned from building a custom static site generator in Rust, covering the full pipeline: querying Git for article metadata (avoiding N+1 process spawning), parsing Markdown into an AST for HTML generation and linting, generating RSS feeds with UUID v5, implementing client-side search with linear indexOf() instead of a trigram index, adding live-reload via SSE in ~100 lines, and caching article builds by hashing inputs. The generator handles ~120ms clean builds and ~50ms incremental builds. Key insights include treating the generator like a compiler, keeping shared mutable state minimal to enable parallelism, and recognizing that linear operations are often fast enough at typical blog scales.
Table of contents
List all articlesParsingLintingGenerate the table of contentGenerate the HTMLGenerate the RSS feedLine numbers in code snippetsGenerate the home pageSearchDraftsLive reloadingCaching and performanceLight & Dark modeConclusionSort: