What Is Hugo?
Hugo is one of the fastest static site generators, written in Go. It builds thousands of pages in seconds, making it ideal for blogs, documentation sites, and portfolios hosted on your Breeze.
Prerequisites
- A Breeze running Ubuntu 22.04 or later
- Nginx installed
- A domain name pointed to your Breeze
Step 1: Install Hugo
sudo apt update
sudo apt install hugoOr install the extended version for SCSS support:
wget https://github.com/gohugoio/hugo/releases/download/v0.124.0/hugo_extended_0.124.0_linux-amd64.deb
sudo dpkg -i hugo_extended_0.124.0_linux-amd64.debStep 2: Build the Site
cd /var/www/hugo-site
hugo --minifyThe output is generated in the public/ directory.
Step 3: Configure Nginx
server {
listen 80;
server_name yourdomain.com;
root /var/www/hugo-site/public;
index index.html;
location / {
try_files $uri $uri/ =404;
}
location ~* \.(css|js|png|jpg|svg|woff2|ico)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}sudo ln -s /etc/nginx/sites-available/hugo /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginxStep 4: Enable SSL
sudo certbot --nginx -d yourdomain.comAutomated Deployment
Set up a Git hook or cron job to pull changes and rebuild:
#!/bin/bash
cd /var/www/hugo-site
git pull origin main
hugo --minifyHugo rebuilds in milliseconds, so deployments are nearly instant on your Breeze.