Seven years ago, when I was in ninth grade, I had taken a computer science class as an elective. Most of my classmates had chosen it because it was considered to be very easy. I, however, had chosen it for a different reason. In my mind, at the time, this was the scale of coolness:
- Partying or going out—not very cool
- Math and physics—kinda cool
- Computers and technology—very cool
Our teacher was probably the smartest person in the school, and one of the brightest people I've ever met. He knew tons about computers, which instantly made him cool. He tried to teach us some basic programming ideas, but he was not very good at managing a flock of loud and recalcitrant teenagers, so most kids just fooled around.
Around that time I got my first phone with Wi-Fi, and started spending more time online reading forum threads, and those other things called blogs, where people wrote about topics they liked, including computers and technology. A website about technology was off the coolness scale.
It was only a matter of time until I asked my teacher to show me how I could create a website. He told me that it was very easy and that I could make basic webpages using only HTML. I started reading about HTML and "coded" a very basic webpage with my name on it. I didn't know about CSS, inline blocks, or the span tag, so I used tables to create navigation bars. Designing basic webpages and writing HTML on paper was my new pastime activity. I was hooked. I downloaded an AMP-type bundle on my home computer and later opened a port on my family's router to be able to view my webpages from anywhere—security was not my number one priority. That worked for a couple of days each time, until our public IP changed. My solution was to wait until I got home to write down our new IP, as I didn't know what DynDNS was.
By the summer of next year, after trying out various free blog hosting services—none of which I liked of course—I somehow convinced my parents to pay for a domain name and shared server subscription, where I could host my WordPress blog. I was becoming cool.
**fast forward five years**
Around one and a half years ago I had the idea of creating my own blogging engine. I would need a VPS to host it, but they had become so cheap that I switched my hosting plan anyway. I had already played around with Flask and deployed a simple web app on heroku for logging my friends' fights that occurred during writing reports for our electric machines lab. As a result, making a basic blogging engine seemed like a fairly easy thing to do. I just never got around to doing it. Instead of that, I ended up making a theme for my blog, that was still running on WordPress at the time. Which brings us to today.
self.blog.engine = Croissant()
As of last week, this blog runs on, or more accurately, is generated by Croissant 🥐. Croissant is a very simple static-file blogging engine I wrote in python in one week. You can find more technical details on github.
I somehow bumped into Brent Simmons' plea for baked blogs, and decided that making a static-file generator was a better idea than making something dynamic based on Flask. The engine's name is a dad-joke-territory pun based on the "baked blogs" idea, but I really liked it and couldn't resist using it.
The project was done for a few reasons, but the main one was definitely to learn something new. It scratched an itch I've had for quite some time, and it was a nice excuse to familiarize myself with things like regular expressions, using YAML files as a very simple database replacement, rendering pages using Jinja2, and doing a lot of OS-level stuff using python. Croissant turned out to be just over 600 lines of code and it's relying on very minimal dependencies—with the exception of Jinja2 #WithFewExceptions. Making it in a week was fun, but definitely challenging at times.
In hindsight, I would've done a lot of things differently. I guess that means the project succeeded, in a way, as I learned new and better ways to solve programming problems. On the other hand, I wasn't too confident with putting the code on github. My biggest quibble with it are the multiple DRY violations. But in the end, I decided that open-sourcing it would be better, as it would also act as an incentive to—hopefully—tidy it in the future.
Making Croissant seems like the ultimate destination of my journey of tinkering with various web technologies while seldomly blogging. It's a way for me to realize one of the dreams my 7-year younger self had. All the cool kids on the block are still writing their own blogging engines, and now I've done it too. I guess the question that remains is, am I a cool kid now?