Today I learned that hugo will happily build nothing and call it success. I was wiring this site’s deploy and the build exited 0, no errors, but the output had no HTML, just a stylesheet and a sitemap pointing at pages that didn’t exist.
The cause: my theme is a git submodule, and the submodule wasn’t initialized. A fresh clone, or a CI runner, pulls the repo but leaves submodule directories empty unless you ask for them. Hugo found an empty themes/ directory, had no templates to render with, and produced a site with no pages. Because there’s technically nothing wrong, no missing file it was told to find, it doesn’t error. It just renders the void.
The fix is two parts. Locally, git submodule update --init --recursive after cloning. On the deploy side, the build needs the submodules pulled before Hugo runs; Netlify does this automatically when submodules are configured, but only if the .gitmodules URLs are public and the submodule is committed at a real ref.
The lesson I’m taking is to distrust a green build with suspiciously little output. Exit 0 means “I did what you asked,” not “the result is what you wanted.” Now my first sanity check on any static build is whether the page count looks remotely right before I trust the deploy.
