Hugo Install Notes
~/.bnux
July 15, 2024
These are just a few gotchas I ran into while setting up Hugo for the first time. Nothing major, but each one cost me some time. Maybe I can save a little of yours :)
JSON or TOML?
I originally created a JSON config file (), which is officially supported by Hugo. However, the build failed on DigitalOcean. I used TOML instead () and that resolved the issue. The site builds locally without issue using either format, but something breaks in the build process.
Related: Hugo defaults to as the config filename, but DigitalOcean's buildpack expects . If your builds are failing for no obvious reason, check the filename.
Hugo Module or Git Submodule?
At first, I added my theme to my local site as a Hugo Module. However, when the site was deployed to DigitalOcean, it errored out on build. From what I can tell in the logs, the build process on DigitalOcean saw and and tried building as a vanilla Go app. I switched to a Git submodule instead, which worked without issue:
Draft Content Doesn't Build by Default
If you create a new page or post and it doesn't show up, check your frontmatter. Hugo sets by default on new content. To preview drafts locally, run (the flag is short for ). Drafts won't be included in production builds, so make sure to set before you deploy.
Allow Inline HTML
By default, Hugo's Goldmark renderer strips raw HTML from your markdown. If you need inline HTML (for things like tags or embedded content), add this to your config:
I'll add to this list if I run into anything else. Hugo is fun to work with once you get past the initial setup quirks.
Discussion in the ATmosphere