While it may not look it, this site is doing some neat things, and some insane things that I swear make sense if you squint at it a bit. But before I get ahead of myself, let's start at the beginning. I think that explaining how I thought through this project and its tradeoffs might be helpful for the Jrs out there trying to plan their own projects.
The "Fall" of Medium and Moving On
So those who know me know that I usually recommend writing on Medium, but in truth that reccomendation had gotten a lot harder to give lately. Years ago, Medium was a vibrant place where you could even sustain a decent side income. But then they went hard with the paywalls, buried anything not behind it, the "market" of writers became incredibly oversaturated, and the quality in general just took a nosedive. And ever since the AI slop hit, it's only gotten much worse.
My articles used to actually be seen by people, at peak there were about 30 to 40 thousand views a month. Now, I'm lucky to hit 2. So I figured, if I'm going to be shouting into the void, I might as well do it on a platform that I have some control over. I briefly thought about other sites like substack, but they just felt like more of the same.
The Requirements
My two biggest complaints about Medium were the fact that there were really no "features" to the site, and everything was paywalled. As someone who got their start on free resources, I want to make sure that no one ever gets locked out. But I also have to compete with other blogs, so I need features that make things worth it. Things like section jumps and syntax highlighting that isn't just bold and italics. But also rarer things you really don't see much like code snippet jump buttons, searching by topic, and actual narrations (coming soon!).
So what to build this in?
Back to Basics
I'm gonna be honest, I've only been coding for 7 years now, but I'm already begining to get burnt out with all the churn on the frontend. I'm tired of there being a new framework every few months that essentially does 1 thing different, yet requires completely new paradigms and syntax. It feels especially bad now that all these frontend frameworks are trying to figure out "the way" to render things on the server.
I want this blog to exist for at least another few years, and the likelihood of React looking anything the same in that timeframe is low. But while all this framework stuff is going on, you know what's just been getting better and better? Web standards. This gave me a thought: "What if I build everything in Vanilla?" It seemed crazy but considering how low tech a blog is, it felt like a good way to get started without much risk.
SSR or Not?
Now that I knew I wouldn't use a framework the question was how would I serve the site itself? And that seemed like another easy decision: static servers are free, real servers aren't. I want this blog to last, but I don't want to pay anything I don't have to (my mini goal is for this to be somehow self-sustaining so having almost $0 costs would help that a lot). The only real trick would be getting some metadata about the pages for things like directory pages, but that didn't seem hard. (Spoilers: using web standards made this really gosh darn easy).
How to save the articles?
I could use a CMS or something to save my work to a DB, but this runs into a cost again. Also, if I screwed up and lost the DB and all my work, I think I would jump off a bridge. No, the way to do this would be without a WYSIWYG editor like I was used to, and would literally write out the files by hand. At lease this would help SEO and page load times, right?
That left me pretty constrained in my choices, I could do markdown, but that would necessitate a lot more complexity in a build step. Plus, I fully intended to put code snippets and interactive pieces into my articles now, which meant I'd probably need something a little more than just .md
.
Return of the King: Raw HTML
That left a seemingly insane option: hand writing HTML files in 2024. But you know what? I had already done that. Like a lot. When I was working at a bootcamp, I wrote an entire mini-js course, and due to constraints (1 week deadline, 100% uptime, slow 3g internet support) I just wrote it all out in HTML. It was annoying, sure, but I added a bunch of vscode snippets and it really wasn't that bad. The question was, how would I structure the little JS code that I needed?
Enter Web Components
I've wanted to try web components for a long time. I always wondered if they could replace React while keeping the "component" based architecture I loved. Now after trying them out, I can tell you: no way dude. There's a long way still to go with state management. BUT! I don't really have a lot of state with a static blog, so that really won't be an issue.
Plus, when using raw .html
files there's a really cool advantage: you can just write components in like it's jsx. Now instead of having to do something like this:
And then calling some functions in my main script, I can just include this snippet:
It's true that Web Components have some clunky APIs, but getting to write components like that in the raw HTML is super cool. I'll definitely be writing about how I used them and you can see for yourself how you like it.
I've already learned so much
The other benefit to using no framework or CMS is that I'm really learning a ton about how the web itself actually works. I finally get SEO stuff like robots.txt
and what a sitemap is. Transferring over domains from one DNS set to another (not as hard as I always assumed, it's...very easy). I can see now how vital each kilobyte of data is (this whole site never sends more than 15kb of JS). Optimizing my graphics so that I can just use straight SVGs (and save hundreds of kbs).
I even got to learn about the ancient JSONP format to knock out an entire JQuery dependency for my mailchimp forms. The Open Graph Protocol was also super fun to learn about and finally let me make my site previews on other sites look professional. Obviously, I still have a long way to go and things to optimize, but it's been a blast so far.
The joy of going on your own
There is so much I want to write about now just from getting this project up and running, but it all boils down to this: it's fun to build things for yourself, and I hope my articles help you do just that. I'm excited to try and build an audience on my own, and write things that everyone can read. So please, follow along with me here and see if it's as fun to read as it is to write. I'll be porting over all my old articles here (with updates!), but I can't wait to start creating new things again. I've never written a monthly newsletter before, so that alone will be a grand new adventure.
Happy coding everyone, and thanks for stopping by!
Mike