little-py-site
October 12, 2016 · Comments
Welcome back, readers! You may have noticed that the site looks a bit different now. Over the last few weeks I’ve redesigned the theme, making it more modern and mobile-friendly, and also converted it from Wordpress to a static site generator, which should make it faster in general as well as hopefully more resilient to the occasional slashdotting. 😅
I ended up building my own little static site generator in Python, and I’ve put it up on GitHub in case it’s helpful as a starting point for anyone else’s efforts.
There are already lots of static site generators around, of which Hugo seems to be most popular at the moment, so why another one? Well, I tried out Hugo first and it’s a very nice piece of software—slick, convenient, and fast—but I had a couple of problems with it. In particular, there doesn’t seem to be a good way to support inline MathJax (LaTeX) code without needing to escape things like underscores, so that Markdown doesn’t try to interpret them. Also, Hugo didn’t offer enough flexibility with the directory structure.
I evaluated a couple other static site generators as well, but ultimately decided to build my own thing for maximum simplicity and flexibility. I used Python-Markdown—an extensible Markdown implementation that allows me to fix the MathJax issue with a plugin—and Jinja, a nice and very fast templating engine.