Deploy Hugo
Hugo is a Go-based static site generator. deploybase runs Hugo builds in a dedicated Docker image with extended features including Sass/SCSS support.
Requirements
Section titled “Requirements”- Hugo site with a valid
config.toml,config.yaml, orhugo.tomlconfiguration file
Configuration
Section titled “Configuration”No special configuration needed. Hugo sites build with hugo --minify by default.
deploybase Defaults
Section titled “deploybase Defaults”| Setting | Value |
|---|---|
| Framework | hugo |
| Build command | hugo --minify |
| Output directory | public |
| Install command | — (none) |
| Docker image | hugomods/hugo:0.139.0 |
Hugo does not have a dependency install step. The Docker image includes Hugo with extended features.
Create and Deploy
Section titled “Create and Deploy”curl -X POST https://api.deploybase.eu/api/v1/projects \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My Hugo Site", "framework": "hugo", "git_repo_url": "https://github.com/user/hugo-site.git", "git_provider": "github" }'Custom Build Command
Section titled “Custom Build Command”To pass additional Hugo flags:
curl -X PATCH https://api.deploybase.eu/api/v1/projects/PROJECT_ID \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"build_command": "hugo --minify --baseURL https://blog.example.com"}'Common Issues
Section titled “Common Issues”Theme not found — Hugo themes added as Git submodules must be included in the repository. Ensure the submodule is initialized. Alternatively, install the theme as a Hugo module.
Hugo version mismatch — deploybase uses Hugo 0.139.0. If your site requires a different version, check for breaking changes in the Hugo release notes.
Custom output directory — If your Hugo config sets publishDir to something other than public, update the project’s output_dir to match.
Sass/SCSS — The extended Hugo image supports Sass/SCSS transpilation natively. No additional setup needed.