Skip to content

Instantly share code, notes, and snippets.

@cariad
Last active June 14, 2025 09:01
Show Gist options
  • Select an option

  • Save cariad/dfecce84ee9d556bccfc8a35ed47c0a2 to your computer and use it in GitHub Desktop.

Select an option

Save cariad/dfecce84ee9d556bccfc8a35ed47c0a2 to your computer and use it in GitHub Desktop.
Install Hugo extended in GitHub Codespaces

Install Hugo extended in GitHub Codespaces

GitHub Codespaces includes Hugo by default, but it's not an extended release.

To install the latest extended release in your codespace container, execute this gist in postCreateCommand of .devcontainer/devcontainer.json:

{
  "image": "mcr.microsoft.com/devcontainers/universal:2",
  "postCreateCommand": "curl -fsSL https://gist.githubusercontent.com/cariad/dfecce84ee9d556bccfc8a35ed47c0a2/raw/dff860658305586c6f3b9d624979b0503575e8a9/install-hugo-extended.sh | bash"
}
#!/usr/bin/env bash
set -euo pipefail
temp_path=$(mktemp -d)
pushd "${temp_path}"
url=$(
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
| jq -r '.assets[] | select(.name | test("hugo_extended_[0-9]+.[0-9]+.[0-9]+_Linux-64bit.tar.gz")) | .browser_download_url'
)
curl "${url}" --location --output hugo.tar.gz
tar -xzf hugo.tar.gz hugo
mv hugo /usr/local/hugo/bin/hugo
popd
rm -rf "${temp_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment