Updating Personal Website with Hugo
Updating Personal Website with Hugo
Why Choose Hugo?
- Fast website generation
- Easy content management with Markdown
- Flexible design options
Setting Up with AWS
The main steps involve:
- S3: Store your website files
- CloudFront: Deliver content quickly
- Route 53: Manage your domain
- Certificate Manager: Handle HTTPS
Unexpected Git Challenges
While working on my Hugo site, I encounter git errors related to large files. In my case, I was unaware that Terraform provider files had created large objects in my git local commits. This prevented me from pushing changes to my remote repo.
To resolve this, I used the git-filter-repo tool:
Install git-filter-repo:
pip install git-filter-repo
Run the command to remove large files:
python3 -m git-filter-repo --strip-blobs-bigger-than 100M
Force push the changes:
git push origin --force --all
This process rewrites git history, removing the large files while keeping commit intact.
Key Points to Remember
- Always check for large files before committing, especially when using tools like Terraform
- Regularly clean your git history to prevent accumulation of large objects
- Be cautious when force pushing, as it can affect collaborators
While the initial setup and troubleshooting might seem daunting, the end result - a fast, secure, and easily maintainable Hugo website - is worth the effort. Don’t be discouraged by these challenges; they’re valuable learning experiences in web development and version control.
Citations: How to deploy a Hugo site to S3 in 2024