rm -rf public/ && hugo --gc --minify
public/ is the finished static site; upload it to any static host. Deleting public/ first guarantees stale files are removed.
netlify.toml builds exampleSite (cd exampleSite && hugo --gc --minify --themesDir ../..) and publishes exampleSite/public, with Hugo 0.143.0.exampleSite/ – every push redeploys.Optional environment variables used by the demo build: GOOGLE_ANALYTICS, DISQUS_SHORTNAME.
Follow Hugo’s Host on Netlify guide and add a netlify.toml like:
[build]
publish = "public"
command = "hugo --gc --minify"
[build.environment]
HUGO_VERSION = "0.143.0"
If the theme is a submodule, make sure submodules are fetched (Netlify does this automatically).
Use the official Hugo workflow (docs). Set baseURL to https://<user>.github.io/<repo>/ (or your custom domain) and check out submodules with submodules: recursive in actions/checkout.
Cloudflare Pages, Vercel, Firebase, S3, nginx etc. only need the public/ folder and Hugo ≥ 0.87.0 (if building remotely).
baseURL is your production URL (affects share links, sitemap, RSS and search result links).params.hostName set if you use share buttons.outputs.home includes JSON (search).static/ and sample posts in content/blogs/.es/fr entries if you don’t need them.hugo --gc --minify locally without errors or warnings.