gnat



init

updated: 2025-04-19

posted: 2025-01-10


Building a Zero-JavaScript Static Site Generator

This site runs on a custom TypeScript static site generator that produces pure HTML with no JavaScript. It loads instantly, works everywhere, and stays maintainable. Most modern sites load megabytes of JavaScript before showing basic content - I wanted something lightweight that starts with essentials and adds complexity only when needed. Content lives in HTML files with metadata in comments, processed through a pipeline: scanning files, extracting metadata, applying templates, and generating static pages. The system uses parallel type-specific handlers with a factory pattern creating appropriate handlers for each content type. Reusable HTML components support nesting for consistent design. During development, a file watcher rebuilds pages instantly when content changes, providing immediate feedback similar to JavaScript frameworks but with static output. Tailwind CSS eliminates context switching between files, making the codebase more maintainable with explicit, localized styling. The site automatically syncs with Bluesky, pulling posts into the feed section and blending crafted content with social updates. The result is a fast, lightweight site that loads instantly, works without JavaScript, and delivers a rich experience through thoughtful HTML and CSS.

I'm interested in dynamic static generation, providing a very fast user experience where all work happens at build time. This ensures the site is always ready to serve users with pre-rendered content that benefits SEO and accessibility. It enables better caching and performance optimization through CDN or edge cache distribution. This approach reduces server load since content generates once rather than for each request. I'd like to explore applying this to other projects, particularly those needing frequent updates or dynamic content.