39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
HUGO_VERSION=0.148.2
|
|
GO_VERSION=1.24.5
|
|
|
|
export TZ=Europe/Oslo
|
|
|
|
# Install Go
|
|
echo "Installing Go ${GO_VERSION}..."
|
|
curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
|
|
tar -C "${HOME}/.local" -xf "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
rm "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
export PATH="${HOME}/.local/go/bin:${PATH}"
|
|
|
|
# Install Hugo
|
|
echo "Installing Hugo ${HUGO_VERSION}..."
|
|
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
|
|
mkdir "${HOME}/.local/hugo"
|
|
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
|
|
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
|
|
export PATH="${HOME}/.local/hugo:${PATH}"
|
|
|
|
# Verify installations
|
|
echo "Verifying installations..."
|
|
echo Go: "$(go version)"
|
|
echo Hugo: "$(hugo version)"
|
|
|
|
# Configure Git
|
|
echo "Configuring Git..."
|
|
git config core.quotepath false
|
|
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
|
|
git fetch --unshallow
|
|
fi
|
|
|
|
echo "Building site..."
|
|
hugo --gc --minify
|