Updating Personal Website with Hugo

Andrew Luo Weimin

techcloud

techcloud

229 Words 1 Minute, 2 Seconds

2025-02-01 10:57 +0000


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:

  1. S3: Store your website files
  2. CloudFront: Deliver content quickly
  3. Route 53: Manage your domain
  4. 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:

  1. Install git-filter-repo:

    pip install git-filter-repo
    
  2. Run the command to remove large files:

    python3 -m git-filter-repo --strip-blobs-bigger-than 100M
    
  3. 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