Have you ever felt frustrated with existing tools and thought, "I could build this better myself"? That's exactly what happened to me on a rainy weekend when I decided to create my own static site generator.
My Website Journey
This website has been through quite an evolution over the years. I've built it with:
- Mambo (remember that one?)
- Joomla
- WordPress
- Custom PHP scripts
- Python scripts
- Plain HTML
At some point, I realized something important: my website doesn't need dynamic interaction. I just wanted an easy way to write and manage content without generating pages on the fly.
The Problem with Existing Solutions
The Markdown Revelation
I strongly prefer writing in my usual text editor over any rich text or Word-like editor. I love writing in Markdown for its simplicity and clear formatting capabilities.
My Experience with Jekyll
After discovering static site generators, I naturally gravitated toward Jekyll - the most popular option with tons of plugins and features. However, I ran into a fundamental problem: I didn't want to learn Ruby and deal with Gems.
My solution? Run Jekyll in a Docker container. Sounds clever, right?
Wrong.
Since I don't update this website frequently, every time I wanted to make changes, the container was broken or outdated. While this isn't Jekyll's fault, it became my recurring headache.
Python Generators
Given my love for Python, I explored Python-based generators like Hyde. While I appreciated having a Python-based solution, the setup was always complex, and it never worked quite the way I wanted it to.
The Inevitable Decision
So what does any self-respecting developer do when stuck with this kind of problem?
Build their own solution, of course!
Why Build Your Own Generator?
Reasons to Do It
- Scratch your own itch - Write software that solves your exact problem
- Because you can - It's a fun challenge and learning experience
- Weekend project satisfaction - Small enough to complete but meaningful enough to be useful
- Try new approaches - Experiment with your vision of simplicity
- Learn about software packaging - Great opportunity to practice Python packaging and distribution
Reasons NOT to Do It
- Plenty already exist - Jekyll, Hugo, Gatsby, Next.js, and many others
- Reinventing the wheel - Time could be spent on other projects
- Maintenance burden - You become responsible for updates and bug fixes
My Approach
I wanted to create something with these principles:
- Minimal configuration - Easy setup with sensible defaults
- Unobtrusive - Stay out of your way while you write
- Pure Markdown - Pages and posts are just markdown files
- Jinja2 templates - Familiar and powerful templating
- Simple command - Build a website by running one command on markdown files
- Self-contained - Templates can be part of the same repository
- YAML configuration - Simple and readable configuration files
Introducing Slartibartfast
I couldn't contain myself - I had to name this after a character from The Hitchhiker's Guide to the Galaxy.
The slartibartfast CLI takes just a few parameters to build a static website. I used:
- Poetry for dependency management and project building
- Typer as the foundation for the CLI interface
- Watchdog to enable auto-reload during development
- Jinja2 as the templating engine
The current version is available on GitHub - it's an MVP I put together to update my website efficiently.
Development Experience
AI tools helped significantly in this project. I've been using Copilot alongside Claude and ChatGPT to accelerate development and explore different implementation approaches.
Future Plans
Eventually, I'd like to:
- Publish this as a proper Python package
- Add more template options and themes
- Perhaps deploy it on AWS Lambda for automated website building
- Build a small community around simple static site generation
More technical details and examples coming soon...