How this site works

17.06.2018

Web development

I’ve sat on this blog idea for ages. Long ago I purchased this domain to make a digital business card. Now I think I’ll mostly use it as a platform for mouho (roughly tranlates to rants).

All the design decisions revolve around minimalism and ease of use. I’ve tried to keep it as simple as possible but I’m sure there are even simpler ways of achieving very similar outputs. This is just overview. I won’t go into too much detail since there a much better resources elsewhere. I linked some of them in this post.

Hosting

The domain name is from Namecheap but I’ve transferred the DNS to Linode nameservers. The actual site is hosted on a Linode VPS (the smallest instance they offer). If I were to do this now I would probably try Netlify’s free offering.

Server

During development I used Nginx for a long time. It was a really good learning experience to figure out how the nginx config files work. Recently, however, I stumbled upon Caddy. I was immediately intrigued with the automated privacy features and straight-forward configuring via Caddyfiles. Also making subdomains and generating certs for them is really easy.

Site

The site is generated with Hugo. I initially thought about using Jekyll but ended up with Hugo since it seemed simpler and more performant. (I didn’t do any proper benchmarking so I might be completely wrong) The theme is a slightly tweaked version of hugo-xmin

Pushing to the site

The site is a bare git repo on the VPS and when I want to publish I push there and a post-receive git hook builds the site.

    #bin/bash

    GIT_REPO=$HOME/villeklar.git
    PUBLIC_WWW=$HOME/public
    WORKING_DIR=$HOME/villeklar

    set -e

    echo "Updating blog..."
    git clone $GIT_REPO $WORKING_DIR
    rm -r $PUBLIC_WWW
    hugo -s $WORKING_DIR -d $PUBLIC_WWW
    rm -rf $WORKING_DIR
    exit 0