Deploy Hugo
Hugo builds in a dedicated image with no dependency install step, so a Hugo deploy is usually the fastest on the platform. Connect the repository in the Quick Start and it deploys.
Two things decide whether it works first time: your baseURL and how your theme is vendored.
Build defaults
Section titled “Build defaults”| Setting | Value |
|---|---|
| Build command | hugo --minify |
| Output directory | public |
| Install command | none |
| Image | ghcr.io/gohugoio/hugo:v0.168.0 |
The image is Hugo’s official one, in the extended edition, with Dart Sass included. Sass and SCSS transpile without extra setup, with either the default LibSass or transpiler: 'dartsass'. Go, Node with npm, and Git are in the image too. Every value above is editable per project, and the full defaults table covers the other frameworks.
Set baseURL to the URL you actually serve
Section titled “Set baseURL to the URL you actually serve”Hugo writes absolute URLs into canonical tags, RSS feeds, sitemaps and most theme templates, using baseURL from your config. The default http://localhost:1313/ ships to production unnoticed, because the pages still build and the site still looks correct until someone follows a feed link.
baseURL = 'https://example.com/'Point it at your custom domain once you have one, otherwise at your .sites.deploybase.eu URL. Keep the trailing slash: Hugo concatenates rather than resolves, so omitting it produces https://example.comabout/.
If you need a different value per environment, override it in the build command instead of editing the config:
hugo --minify --baseURL https://example.com/Commit your theme, or use a Hugo module
Section titled “Commit your theme, or use a Hugo module”Builds clone one repository at one commit. Git submodules are not initialised, so a theme added as a submodule leaves themes/your-theme/ empty and the build fails with a missing layout.
Either vendor the theme into the repository:
git rm --cached themes/your-themerm -rf themes/your-theme/.gitgit add themes/your-theme && git commit -m "vendor theme"Or switch to a Hugo module, which the build resolves over the network like any other dependency:
[module] [[module.imports]] path = 'github.com/theme-author/your-theme'Modules need go.mod and go.sum committed. Without go.sum the build fails on a checksum mismatch rather than fetching the theme.
Pin the version you build against
Section titled “Pin the version you build against”Every site builds with Hugo 0.168.0. We move to new Hugo releases as they come out, so this version goes up over time. You cannot choose a version yet: setting HUGO_VERSION has no effect, because nothing in the image reads it. That variable is a Netlify convention, not a Hugo one.
Declare the oldest release your site works with, so a build on an older Hugo fails loudly rather than rendering wrong:
[module] [module.hugoVersion] extended = true min = '0.168.0'If your site needs a specific release, say so at support@deploybase.eu and tell us which one.
When it breaks
Section titled “When it breaks”Error: module "your-theme" not found. The theme is a submodule that was never vendored. See above.
Every internal link points at localhost. baseURL was left at its default. See above.
The build succeeds but the site is empty. Your config sets publishDir to something other than public. Set the project’s output directory to the same path, or drop the override.
Pages are missing from the deploy but present locally. Content with draft: true, a future date, or an expiryDate in the past is excluded from a production build by design. Add --buildDrafts, --buildFuture or --buildExpired to the build command if you meant to publish them.
TOCSS: failed to transform. The standard Hugo image cannot compile Sass, but ours is the extended build, so this one points at something else: usually a @import path that resolves only on a case-insensitive filesystem. Linux is case-sensitive; macOS is not.
Live a8b7eb1d built