Written by Matthew Turner on 2023-01-08

First Post

Hello there everyone! I finally did it. I made a post on my website that has been up for years. I never really knew what I wanted this site to be exactly, and I still don't know what it is, but for a long time, I've just been maintaining this site manually, and I knew that there had to be a better way. "But Matthew!" I hear you cry in my totally-non-delusional mind, "This site hasn't changed since it was put up." Well, you'd be right except for one thing, mostly. The copyright date at the bottom of the page. Yep, every year (or so — if I thought of it) I was manually changing the copyright date on every single page individually (all three of them!). This year, the year of our Lord 2023, I decided I've had enough of that!

So, I wrote a tiny bit of code that allows me to build my website from templates. It took all of a couple of hours, like fifty-ish lines of Python, and the amazing Jinja2 library to do all the work for me. And voilà I am now able to change my copyright date in a single file, run a simple script and BAM my whole site is updated. It was around this time I learned that there are several existing static site generators that have really cool features for things like making blog posts and other such nonsense. One that stood out to me in particular is called Jekyll. It allows you to write posts in Markdown, and it converts those posts to HTML and crams them into a template of your choosing along with some metadata (basically). I thought "wow that's neat" and so instead of actually using Jekyll I crudely made my own vaguely-similar-in-some-ways-but-with-a-lot-less-features thing. Several more hours, another hundred-ish lines of Python, the wonderful Python Markdown library to do all the work for me, and BOOM now I can write posts using Markdown, and they end up on my site in all the right places. If you're interested, you can view the entire source for this website here. Take a look at generator.py if you're just interested in how the final pages are actually generated from the templates.

It's so easy to use that I'm actually using it. Well, it remains to be seen how many posts I will actually write, but there are a few topics I've been wanting to share some thoughts about. I may write about collecting NOAA satellite images (from SPACE!) using a cheap software defined radio and a bunny-ear antenna. Or I may share my recently broadened understanding of Separating Axis Theorem as it relates to collision detection when you're writing video games from scratch. Maybe I will just have an urge to rant about whatever is going on in the world at the moment. All of these things may or may not end up on this site at some point. And sure, some of these topics have already been discussed to death on the internet, but I've never been one to leave a dead horse unbeaten. Also, maybe I have a fresh perspective that could be helpful to some, or perhaps it will just serve to help me remember what I've learned.

So Long, For Now

Whoever you are, and wherever you are, I hope you have a wonderful day. This isn't related to anything you just read about, but I want to leave you with a bit of music. Both because it is good, and because many of the people I've met need to hear it. So remember to Be Kind To Yourself.

Tags:
  • [markdown]
  • [python]
  • [ramble]
  • [static-site-generator]
Description:

This is the first post on my website that is testing out my home-made static site generator. I already think having a separate description was a bad idea and I need to find a way to pull an excerpt from the post automatically. Anyway, this is how it is for now and inside this post you will find lots of rambling and meandering thoughts for your reading pleasure (or whatever). Enjoy!