Jaco du Plessis

New Blog Setup

python pelican static site

My first site was running on WordPress on shared hosting. After getting fed-up with the poor security of the WordPress ecosystem, I started looking into static site generators (SSGs).

I built sites in Jekyll, Pelican, Hugo. They're all great pieces of software. The main issue I have with these SSGs is that they use the filesystem as database, usually in a git repository, which means I can (practically) only add new content from my laptop.

Then I build a custom system using Frozen-Flask with a Trello board as the CMS. This actually worked quite well, but this would create a hard dependency on the Trello service, which didn't feel quite right. Also, I lost all the functionality built into those real SSGs (they can't build from a JSON file), as well as the revision tracking that comes with a git-based system.

The I moved to a self-hosted instance of Ghost. I did this using Cloudron, which basically made it a one-click install and comes with a good default theme. The theme, however, annoyingly loads assets from Google servers, so I would have to customize the theme to get past that. But more importantly, I would now have to pay for a server to keep it running – I'd prefer a free solution. Also, I justified a dynamic site because I thought I would be adding content regularly, which turned out to just be one of those new year resolution things.

Gitlab has a great feature called Pages that allows using their free continuous integration servers to build and host static sites. So now I've build a Pelican site using with a custom Bootstrap 4 theme, hosted on Gitlab Pages. In the past I generated my own SSL certificates and added them to GitLab, but this requires maintenance every 3 months, and since I'm already using CloudFlare for DNS, I'm using their HTTP Proxy to add SSL for the site.

I chose pelican because it's written in Python, which gives me some piece of mind that I can easily create a plugin if I need some custom functionality, and I could use Jinja2 templates, which I'm very familiar with. I don't know Ruby (jekyll) and my Go (hugo) skills are very basic. Performance is not really a factor I consider here because I have little content and builds are infrequent.

Have a comment? Email me at jaco@jacoduplessis.co.za.