Hugo Setup on Ubuntu

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.