I’ve just finished converting my site to use Jekyll, replacing WordPress. Hopefully I’ve preserved the permalinks for every post and page as best as possible. This will have reset the RSS feed’s post IDs though, so if you follow this blog via RSS: 1) What’s wrong with you? 2) Sorry, won’t happen again (at least for a while)

The main reason behind this change is that WordPress is just a big heavy thing that I don’t need most of. It’s also a huge attack surface - I keep it up to date, but the sheer amount of bots and stuff trying to break into wp-login.php and find potential exploits in files in theme and plugin files is ridiculous. Jekyll has none of these issues because it’s a static site generator: it just spews out HTML files. There’s no server-side code at all. Everything loads instantly and you can host it bloody anywhere.

I have the source for this site set up in a Git repository hosted on my own GitLab instance. I use GitLab CI to automatically build and deploy the site here (drinkybird.net) via rsync when I update the master branch. I may move the site to Amazon S3 + CloudFront eventually, but I still have other stuff here that I’d have to move first.

Jekyll uses raw Markdown (or HTML) files for which I just use a standard text editor (currently, Notepad++) to write. There’s no web interface like Wordpress, but GitLab does provide a web IDE, which is a mostly-functional in-browser version of VS Code. I have no idea whether changes I make persist between sessions in the web IDE without commiting them to the Git repository though, but if it does then that’ll be useful if I’m ever in a situation where I can’t use git directly (on my phone or tablet?) I could even deploy to GitLab Pages as a preview when I don’t have access to the local jekyll serve command.

I’m using the default Minima theme, albeit modified a bit. Mainly, the colours are different. I like this purple, but it does look a bit like the default a:visited colour, so I might not keep it. I dragged the entire theme into my source tree - this is probably a bad idea, but it makes it easier to modify stuff if I need to. I might switch it to a serif font, I generally prefer those for reading.

Setting up the Archives page was a bit hacky. The pages that page links to (the pages for each month, category, tag, etc) were generated using the jekyll-archives plugin, but that plugin doesn’t seem to have the ability to generate a list of the archives it creates. The categories and tags sections was easy. The by month section, not so much:

{% assign date_list = "" %}
{% for post in site.posts %}
	{% capture post_date %}{{ post.date | date: "%m,%Y" }}{% endcapture %}
	{% assign dates_split = date_list | split: ":" %}
	{% unless dates_split contains post_date %}
		{% capture date_list %}{{ date_list }}:{{ post_date }}{% endcapture %}
		<li><a href="{{ site.baseurl }}/{{ post.date | date: "%Y/%m" }}">{{ post.date | date: "%B %Y" }}</a></li>
	{% endunless %}
{% endfor %}

Ugly, but it works! At least it doesn’t run every time you visit the page.

Speaking of, that’s another nice thing Jekyll has: syntax highlighting that doesn’t suck. On WordPress syntax highlighting is all done by plugins that all suck in some way or the other. I used to use one that only had support for a few programming languages, before I switched to one that supported a load of languages but required bringing in a giant library (I think it was VS Code’s highlighting engine?). In Jekyll it’s built in and you just use the usual Markdown syntax to highlight code.

The only thing I’m really missing from WordPress is comments. Nobody commented on the WP site anyway, because nobody reads this site at all nevermind leaves comments, but it was nice to have the feature. I’ve used Disqus before but I think I’d prefer something self-hosted… I’ll sort something out in that regard.

This is all for now. I wish I could use this blog more, but my life is not that interesting. I’m working on a project that might be more blog-worthy, though, so we’ll see.