Testing testing testing

It’s been a bit since I’ve looked at my Hugo blog here on shindakun.dev.

Hugo

First things first, I need to get all my repositories in line. When I originally set everything up I had it separated in a couple different repos. The main repo held everything needed to build the base Hugo. I had two submodules for the themes that power the site. Finally, I had a repo just for blog posts. Why I didn’t include the blog posts repo as a submodule originally is lost to time though. We’re going to add them in as a submodule much like our themes.

git submodule add https://github.com/shindakun/posts

Now we can just run

git clone --recursive  https://github.com/shindakun/shindakun.dev.git

And we’ll get the entire site. Since the site running behind Nginx we can then just build it and server from the public directory.

Nginx

The currently deployed version of the site is just a copy of the public directory and the configuration looks like

server {
    server_name shindakun.dev;
    root /var/www/shindakun.dev;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    listen [::]:443 http2 ssl; # managed by Certbot
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/shindakun.dev/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/shindakun.dev/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    if ($host = shindakun.dev) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;

    server_name shindakun.dev;
    return 404; # managed by Certbot
}

We’ll update root /var/www/shindakun.dev; to be root /var/www/shindakun.dev/public; once everything is sorted on the server itself.

But why?

Why do any of this? Well, keeping a blog is something I’ve always enjoyed - though sometimes I’m not very good at it. Mostly because I link to tinker. While I don’t fully run my server I manage most aspects of the Digital Ocean droplet I use. I used to use Ghost, but it has slowly gotten to the state where I could only run a single blog on a droplet. Whereas if I use Hugo I can run countless websites with nothing but Nginx.


Enjoy this post?
How about buying me a coffee?