My personal website.
Find a file
2024-09-28 00:48:52 +02:00
archetypes First. 2024-09-24 23:49:00 +02:00
assets Third. 2024-09-26 11:11:01 +02:00
content Sidenote things and lots of css 2024-09-28 00:41:56 +02:00
public Update script 2024-09-28 00:48:52 +02:00
resources/_gen/assets Sidenote things and lots of css 2024-09-28 00:41:56 +02:00
static Post-receive git hook, live test. 2024-09-27 15:31:20 +02:00
themes Update script 2024-09-28 00:47:53 +02:00
.gitmodules Update... 2024-09-27 19:18:44 +02:00
.hugo_build.lock Third. 2024-09-26 11:11:01 +02:00
go.mod Second. 2024-09-26 11:09:00 +02:00
go.sum Second. 2024-09-26 11:09:00 +02:00
hugo.yaml Update... 2024-09-27 19:39:09 +02:00
README.org Post-receive git hook, live test. 2024-09-27 15:29:50 +02:00
update.sh Update script 2024-09-28 00:48:52 +02:00

Bajsicki.com

This is the git for my personal website. Nothing to see here, just pretty vanilla hugo stuff.

Deployment

I'm basing my own deployment of hugo on my server on this article by Jason Murray. I don't have much to change here, and his way of deploying makes a lot of sense to me.

I'm breaking it up here with a lot of his comments, simply so I don't get lost when reviewing this in a few years/ months.

#!/bin/bash
# Directory on the server where the website will be mapped.
export GIT_WORK_TREE=/srv/bajsicki.com

echo `pwd`
echo "post-receive: Generating https://bajsicki.com with Hugo..."

# Create the directory and all subdirectories if they don't exist.
mkdir -p $GIT_WORK_TREE
chmod 755 $GIT_WORK_TREE

# Check out the contents of the repository and extract the files to $GIT_WORK_TREE
git checkout -f main

# Remove any files already in the public directory, a fresh copy will be generated by hugo
rm -rf $GIT_WORK_TREE/public

# Generate the site with hugo
cd $GIT_WORK_TREE && /usr/bin/hugo

# Fix any permission problems.
find $GIT_WORK_TREE/public -type f -print | xargs -d '\n' chmod 644
find $GIT_WORK_TREE/public -type d -print | xargs -d '\n' chmod 755

echo "post-receive: Hugo site generation complete"