diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 99d3543..8a36e1d 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -9,25 +9,62 @@ This guide explains how to deploy this Hugo website to an LXC container running - Git installed on container - Domain name `dustin.coffee` pointing to container's IP address (or adjust baseURL in `hugo.toml`) -## Step 1: Install Hugo on LXC +## Step 1: Install Hugo Extended on LXC -On the container, install Hugo (extended version recommended): +**Important**: This theme requires Hugo **extended** version ≥ 0.123.0. Ubuntu's default apt repository provides an outdated version (v0.123.7). You must install a newer extended version. + +### Option A: Using installation script (Recommended) + +Copy the `install-hugo.sh` script to your container and run it: ```bash -# For Arch Linux -sudo pacman -S hugo - -# For Debian/Ubuntu -# sudo apt install hugo - -# For other distributions, see https://gohugo.io/installation/ +# On your container, as root or with sudo: +chmod +x install-hugo.sh +./install-hugo.sh ``` -Verify installation: +### Option B: Manual installation for Ubuntu/Debian + +```bash +# Remove old Hugo if installed +sudo apt remove -y hugo + +# Add Hugo APT repository +ARCH=$(dpkg --print-architecture) +echo "deb [arch=${ARCH} signed-by=/etc/apt/keyrings/hugo.gpg] https://hugo-apt.8hob.io latest main" | sudo tee /etc/apt/sources.list.d/hugo.list +sudo chmod 644 /etc/apt/sources.list.d/hugo.list + +# Add signing key +sudo mkdir -p /etc/apt/keyrings +sudo wget -O /etc/apt/keyrings/hugo.gpg https://hugo-apt.8hob.io/signing-key +sudo chmod 644 /etc/apt/keyrings/hugo.gpg + +# Pin repository priority +echo 'Package: hugo +Pin: origin "hugo-apt.8hob.io" +Pin-Priority: 520' | sudo tee /etc/apt/preferences.d/hugo +sudo chmod 644 /etc/apt/preferences.d/hugo + +# Install Hugo Extended +sudo apt update +sudo apt install -y hugo + +# Install git (required for Hugo modules) +sudo apt install -y git +``` + +### Verify installation + +Check that you have the extended version: + ```bash hugo version +hugo env | grep HUGO_EXTENDED +# Should show: HUGO_EXTENDED=true ``` +If `hugo version` shows v0.123.7 or earlier, the installation failed. Try Option B or install the binary manually from [Hugo releases](https://github.com/gohugoio/hugo/releases). + ## Step 2: Clone Repository Clone your git repository to a directory, e.g., `/srv/www/dustin.coffee`: diff --git a/install-hugo.sh b/install-hugo.sh new file mode 100644 index 0000000..9638014 --- /dev/null +++ b/install-hugo.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Install Hugo Extended on Ubuntu LXC container +# Run as root or with sudo + +set -e + +echo "Installing Hugo Extended on Ubuntu..." + +# Check current Hugo version +if command -v hugo &> /dev/null; then + echo "Current Hugo version:" + hugo version +fi + +# Remove old Hugo from apt if installed +echo "Removing old Hugo installation..." +apt remove -y hugo 2>/dev/null || true + +# Add Hugo APT repository +echo "Adding Hugo APT repository..." +ARCH=$(dpkg --print-architecture) +echo "deb [arch=${ARCH} signed-by=/etc/apt/keyrings/hugo.gpg] https://hugo-apt.8hob.io latest main" | tee /etc/apt/sources.list.d/hugo.list +chmod 644 /etc/apt/sources.list.d/hugo.list + +# Add signing key +mkdir -p /etc/apt/keyrings +wget -O /etc/apt/keyrings/hugo.gpg https://hugo-apt.8hob.io/signing-key +chmod 644 /etc/apt/keyrings/hugo.gpg + +# Pin repository priority +cat > /etc/apt/preferences.d/hugo <