Hugo
- Self-Hosted Hugo Blog: Forgejo + Forgejo Actions + nginx + Traefik
A walkthrough of migrating this blog off AWS (CodeCommit + CodeBuild + S3 + CloudFront) onto a self-hosted stack using Forgejo for git and CI/CD. Most of the config was written by Claude Code. The old AWS stack was four services doing what two containers now do. The migration was part of a consolidation onto Oracle Cloud free tier VMs. The target infrastructure was already there: a Forgejo instance on one VM and a Docker/Traefik apps server on another.
- Delete AWS CloudFront Cache Automatically when Building and Deploying with CodeBuild
I use AWS CodeBuild to build and then deploy this Hugo static site to s3. The site is also sat behind Amazon’s CloudFront CDN and after a sucessful deployment I wanted to delete the cache automatically so I could see the changes from the build immedietly.
- Running a Custom Docker Image on Amazon CodeBuild
I needed to use a custom docker image for some Dotnet Core 3 work with Amazon CodeBuild and hit into a few issues that took a bit of digging around to find, so thought I’d leave the here should anyone else need the same info.
- Hugo - Failed to find a valid digest in the 'integrity' attribute for resource
After cloning my Hugo site to a new machine and running: hugo server No CSS would load and the console was reporting the following error: Failed to find a valid digest in the 'integrity' attribute for resource The problem was that the CSS for the theme is using the integrity attribute to allow the browser to guarantee that the file downloaded has not been manipulated from the source. For some reason Hugo was regenerating the CSS with a different hash than what was expected, I suspect this might be a git line ending issue.
- Hugo NoSuchKey on Sub Folders After Deploying to Amazon S3 and CloudFront
After deploying this blog to Amazon S3 with CloudFront the main page rendered correctly but any pages in sub folders like /posts or /posts/post-vanity-url would recieve the following error: <Error> <Code>NoSuchKey</Code> <Message>The specified key does not exist.</Message> <Key>{path}</Key> <RequestId>{RequestId}</RequestId> <HostId> {HostId} </HostId> </Error> Hugo uses directory URLs by default (posts/post-vanity-url) instead of files names (/posts/post-vanity-url/index.html). S3 is an object storage system not a file system. When a directory URL is passed to the server, it looks for the default root object in that directory. Asking for a directory fails to retrieve the index.html file in that folder.
- Building Hugo Extended on AWS CodeBuild
After upgrading my Hugo theme to the Hyde inspired Hyde-Hyde theme I also needed to switch from the standard Hugo build to the extended build in order to use the pipes feature. After successfully installing the new theme locally I hit into problems running the extended version of Hugo on AWS CodeBuild. First I received the following error: