How this site is built and published
Meta-content time!
As the site develops, this post will be updated.
Static blog engine: Hugo
The excellent Hugo is used to build this site.
Now that I’ve configured and tweaked Hugo it mostly stays out of the way. I can quickly preview and iterate what I’m doing in a local browser (and the automatic reloading is doubleplusgood).
Hosting
This site is hosted from a worker in a free-tier Cloudflare account. The worker does a Hugo build and deploy on any changes to the github repo for this site; I just have to push to github to update the site (and the update to the live site is very quick).
Cloudflare obviously want to up-sell you to a paid account, so the free tier has various things nerfed, e.g. any embedded video player is stripped out.
The free-tier Cloudflare account does make some analytics available to you.
Analytics
For anonymous visitor stats I’m using Plausible.io, self-hosted in a Digital Ocean droplet.1
I wanted to avoid Google Analytics for privacy reasons (and it’s bloated, to boot).
I’ve integrated Plausible into Hugo by using the Community plugin (which Plausible themselves recommend as the best way).
Removing your own live site visits from stats
There’s a few ways to achieve this. I’m using the local storage method which is pretty convenient.
Avoiding Ad-blockers skewing your stats
Some users’ ad-blockers stop the Plausible script from loading, which means no analytics are reported.
If you’d like to get around that, have a look at the proxy method that Plausible recommend.
I’ve not implemented this myself yet, but I’m considering it. Personally I’m OK with defeating an ad-blocker if it’s for privacy-first analytics like Plausible.
Command line tooling
I’m using Just to build and locally serve Hugo content. It’s like make
without the tentacles and horror.2
Punctuation conversion in markdown
Hugo sometimes does automatic conversion of e.g. upright apostrophes '
into pairs like ‘this’, but in some cases I’ve had to manually use left and right apostrophes. I probably need to tweak the config more.3
In the same vein, if I type ‘--’ (two hyphens) then I end up with an em-dash ‘–’, which is what I want.4
Maths content
I’m using the MathsJax plugin to typeset equations.
It turns this:
$$
f(a, b) = \textrm{rot}_\psi(a, 30) + \textrm{rot}_\theta(b, 30)
$$
into this:
$$ f(a, b) = \textrm{rot}_\psi(a, 30) + \textrm{rot}_\theta(b, 30) $$which is remarkable, especially to a simple-minded farmhand from Tatooine like me.
Abecedarium
It’s handy for a writing site to have an Abecedarium for quick checking of rendering, and as a place to record any house-style reminders. Here’s mine.
I’m using the second-from-bottom tier droplet, which has 1GB RAM. Plausible recommend 2GB but my understanding is that 1GB is fine (but you may need to revise that if your site gets very popular) ↩︎
notable: unlike Ninja or the venerable
Make
, Just doesn’t have a notion of caching or rebuilding dirty dependencies built-in. But sometimes you just don’t need that ↩︎see e.g. Goldmark markup configuration ↩︎
for more on em-dash and hyphens: https://archive.is/AmOrq ↩︎