icon

Bjarne Verschorre

Moved From Github

Why I moved from GitHub Pages back to my original setup.


Background

In this post I talked about moving my hosting to GitHub Pages. I was happy with the setup, but I missed some features that I had with my original setup. I decided to move back to my original setup.

Why I moved back

GitHub Pages is a good solution for some people, you push to the repo and your site gets updated, But it wasn’t for me. I missed some features that I had with my original setup like:

My current setup

In my original setup I used to just drag and drop the files to the server. Now I’m using a small bash script that compiles my Hugo website and uploads it to the server. I can now just run ./deploy.sh and my website is updated.

I used to use the -D flag to compile “darfts” as I was using that “withheld” posts. This wasn’t very efficient since I wasn’t able to use draft in it’s intended way. I just added a different tag to those posts which tells Hugo to compile them and I could make sure they weren’t public.

This is the script I use:

#!/bin/bash

echo "Building..."
hugo --gc --minify --cleanDestinationDir --quiet
if [ $? -ne 0 ]; then
    echo "Build failed"
    exit 1
fi

echo "Uploading..."
rsync -avzq --delete public/ <SSH Connection> 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
    echo "Upload failed"
    exit 1
fi

echo "Finished!"

It’s very simple and it works for me. I’m happy with my current setup and I don’t think I’ll move again.

← Tmux Cheatsheet A Beginners Guide to Linux Distros →