Oct 9 2022

Building a (math) blog from scratch

For a while now, I have wanted to start writing a blog. Why? Principally because I like writing and want a public repository of my writing available, but also for the discipline of documenting my interests consistently.

In any case, I decided to write a blog. The familiar options available, Wordpress, Tumblr, Medium and Substack did not appeal to me, because although they were accessible and allowed you to focus on just writing and sharing your writing with others, they were not very flexible when it came down to customisation and LaTeX support (which was important for me since I wanted to write some math). For a while, I was convinced that this was only a petty consideration, a way to procrastinate on actually writing and reaching an audience. But recently I realised how much difference it makes to have your own little corner to do your work in, as you would prefer it. In any case, I drew a list of specifications for what I wanted:

  • to write posts in a mixture of both Markdown and LaTeX
  • to write a post, dump it in a folder, commit and the blog is updated automatically
  • the entire site is easily customised
  • the entire site is responsive
  • it is free
  • it looks pretty

Since nothing that was already out there appealed to me, I decided to build my own blog. For the sake of simplicity, I chose to focus on static site generators, rather than building my own little web app for blogging. Again, there are many options for blogging using static site generators. To name a few, there is Jekyll, Hugo, etc. but (again) none of them appealed to me. For Jekyll, I quickly got fed up trying to customise the theme as I would have liked it. So, the time came to build my own static site generator for blogging from scratch.

Now, I haven’t been programming consistently for a while and I had never done any serious web development beyond basic HTML and CSS pages so I was a bit reluctant to get down to the actual business of building this little thing. I knew conceptually speaking it wasn’t too difficult, but just because something is simple, does not mean it is easy. However, after simplifying the task considerably, I ended up doing it. Here is roughly how it went down.