Hello, Pelican!

This is a post celebrating successfully switching this site/blog over to the static site generator Pelican. Why is this a big deal? For a couple of reasons:

The first reason is that WordPress is a fairly "heavy" framework. There's a lot of opportunity for security issues. For a single-person blog it's also rather too complex. Having to log in every time and dealing with spam comments was a hassle.

The second reason is so I can uninstall PHP from the server, a move in line with my goal of living a PHP free life :)

The final reason is that this allows me to write blog posts from my terminal. This might mean I take the time to write stuff more often, since I don't have to deal with the slow/brittle JS based editor in WordPress.

The process of moving over to Pelican involved a number of steps. First I had to export all posts from WordPress to an XML file. Next I used pelican-import to convert the WordPress XML to a set of Markdown files. I wrote a shell script to fix up the output of pelican-import in various ways, mostly related to image captions. I also had to make sure all the old WordPress uploads still worked, such as pictures and .grc files. There is a slight issue currently since some of the uploads are videos, and each time I rebuild the site they are copied from the content directory to the output directory. There is a pull request on the Pelican GitHub page (link) slated for version 3.8 which changes this copying to using hardlinks. This makes the generation process much faster since it doesn't have to copy gigabytes of data every time.

One side-effect to switching to a static site is the loss of comment functionality. I plan on handling comments via e-mail, and inserting any interesting ones manually in the relevant posts. Optionally comments may be submitted over OStatus/Mastodon/GNU Social.

Things to do:

  • CSS
  • Video transcoding + HTML generator script
  • Fix some of the videos that did not import properly
  • Thumbnail generation (unless Pelican already does that)
  • An "about" page
  • HTTPS via Let's Encrypt