1. Install Latest Hugo Extended (Ubuntu amd64)#
Use this script to automatically fetch and install the latest .deb package from GitHub.
#!/usr/bin/env bash
echo "Installing latest Hugo Extended..."
ARCH=$(dpkg --print-architecture)
if [ "$ARCH" != "amd64" ]; then
echo "This script currently supports amd64 only."
echo "Detected architecture: $ARCH"
exit 1
fi
echo "Fetching latest version..."
LATEST=$(curl -s [https://api.github.com/repos/gohugoio/hugo/releases/latest](https://api.github.com/repos/gohugoio/hugo/releases/latest) \
| grep '"tag_name":' \
| sed -E 's/.*"v([^"]+)".*/\1/')
if [ -z "$LATEST" ]; then
echo "Failed to fetch latest version."
exit 1
fi
echo "Latest version: $LATEST"
FILE="hugo_extended_${LATEST}_linux-amd64.deb"
URL="[https://github.com/gohugoio/hugo/releases/download/v$](https://github.com/gohugoio/hugo/releases/download/v$){LATEST}/${FILE}"
echo "Downloading $FILE..."
wget -q --show-progress "$URL"
if [ ! -f "$FILE" ]; then
echo "Download failed."
exit 1
fi
echo "Installing package..."
sudo dpkg -i "$FILE"
sudo apt-get -f install -y
echo "Cleaning up..."
rm -f "$FILE"
echo ""
echo "Installed Hugo version:"
hugo version
echo ""
echo "Done."2. Install Blowfish Theme#
Commands to initialize your project (e.g., canada2argentina) and install the Blowfish theme as a submodule.
2.1. Initialize Submodule#
# Navigate to your project directory
# Initialize git and new site
git init
hugo new site . --force
# Add Blowfish as a git submodule
git submodule add --depth 1 https://github.com/nunocoracao/blowfish.git themes/blowfish2.2. Configure Theme Files#
# Create the necessary config directory
mkdir -p config/_default
# Copy the configuration files from the theme to your project
cp themes/blowfish/config/_default/*.toml config/_default/
# Remove the default hugo.toml if it exists (using separate config files instead)
rm hugo.toml3. Migration & Utilities#
3.1. WordPress Export Tool#
apt install nodejs npm -y
# Then run: npx wordpress-export-to-markdown3.2. Development Server Commands#
Use these to preview your site on your local network.
HP1Docker Homelab preview: persistent systemd service, starts at boot and serves http://10.1.2.202:1313.
Service file: /etc/systemd/system/hugo-homelab-preview.service. It runs as marc with this command and resource directory:
Environment=HUGO_RESOURCEDIR=/var/lib/hugo-homelab-preview/resources
ExecStart=/usr/local/bin/hugo server --bind 0.0.0.0 --baseURL http://10.1.2.202 --buildDrafts --disableFastRender --ignoreCache --noHTTPCache --gc --destination /var/lib/hugo-homelab-preview/public --port 1313Systemd creates /var/lib/hugo-homelab-preview/ for this service’s generated preview files, keeping them separate from the site’s existing production public/ and resources/ directories. The service retries failed starts after 5 seconds, with a per-service limit of 3 attempts in 60 seconds.
Check or manage this service on HP1Docker:
systemctl status hugo-homelab-preview.service
journalctl -u hugo-homelab-preview.service
sudo systemctl stop hugo-homelab-preview.service
sudo systemctl start hugo-homelab-preview.serviceIf the service reaches its retry limit, fix the logged cause, then clear its failed state before starting it:
sudo systemctl reset-failed hugo-homelab-preview.service
sudo systemctl start hugo-homelab-preview.serviceFor Mac Studio/Local:
hugo server --bind 0.0.0.0 --baseURL "http://10.1.2.4" --buildDrafts --disableFastRender --ignoreCache --noHTTPCache --gc -p 13134. Deployment#
Link your repository to Cloudflare Pages for automatic deployment:
- Cloudflare Dashboard: Workers & Pages