- HTML 89.4%
- Shell 10.6%
Adam's Website
Build pipeline Status 30-day uptime License: CC BY-SA 4.0 Conventional Commits
Hey 👋, welcome to the repo of my personal website built with Hugo! It uses the Congo Hugo theme and is deployed on statichost.eu 🇪🇺.
Running Locally
To see your changes, first check that Hugo is installed by running hugo version, and then start the Hugo server with hugo server (you can also add the -D flag to enable drafts, but I never seem to be using them), then go to the shown localhost link (which has live reload!). Refer here for more Hugo documentation.
Deploying
To build the site and deploy it to adam.sr using statichost.eu, simply push the changes to the main branch of the Codeberg repo! Behind the scenes, there is a forgejo webhook configured in the settings of this repo that notifies the statichost builder to automatically build and deploy the site!
Statichost uses the build config specified in the statichost.yml file. In essence, statichost takes a Docker image (note that Congo requires an extended Hugo version along with go and git, see here), a build command, and an output directory, and runs the build command in that docker image, and then deploys the static files from the build directory.
Note that in my case, since I use Congo as a Hugo module, I go for a full clean of the hugo module cache in my build command using hugo mod clean, and then fetch the last version of Congo which I tested using hugo mod get ${url-of-congo}@${specific-version-of-congo}.
Debugging
If Hugo fails to build the site and displays a warning message, try cleaning Hugo module cache by hugo mod clean and refetch the Congo module by hugo mod get ${url-of-congo}@${specific-version-of-congo}. Also check out Congo repository for Issues/help.
Upgrading
To upgrade the version of Congo, see the docs here and make sure to read the release notes of Congo for announcements and breaking changes.
Essentially, run hugo mod get -u, and then run the website and check it for breakage (I know, lack of tests).
Then, if everything looks good, update the new congo version in the statichost build command (command: ...) in the statichost.yml file. Lastly, commit everything and push!
TODOs
- Add some CI tests to the website (e.g. check broken links), see this (also check out why the woodpecker CI is failing, maybe the webhook is wrong?)
- Make a tutorial/blog about deploying Hugo to statichost.eu and migrating from Codeberg pages
License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).