Build flags

Configure garbage collection, minification and the Hugo build environment per site.

Last updated

Every publish builds the site first. The Build section stores its Hugo flags per site and shows the resulting command.

The flags

On the Deploy page, per site:

  • --gc – run Hugo’s garbage collection after the build, clearing stale entries from its cache.
  • --minify – minify the built output.
  • Environment – the build environment Hugo runs in (--environment), for config and templates that switch on it. Leave it blank for Hugo’s default.

Both flags are enabled by default, matching builds made before the settings were added. The displayed command updates when a setting changes.

The environment field

The environment field accepts letters, numbers, hyphens and underscores. Values beginning with - or containing spaces and additional command text are rejected, and the generated command remains unchanged.

Where it applies

Build flags belong to the site, not the target, so they carry across however you publish – a local GitHub Pages build or an FTP/SFTP upload both build with your flags on your Mac. Preflight uses the environment flag too, so the check builds against the same config the publish will.

The walkthroughs: Publishing to GitHub Pages · Publishing over SFTP.

Latest release · 17 October 2026

HugoKit 0.5.0

0.5.0 adds Split Preview, page duplication, reusable archetypes, a media library, translation drafts and batch editing. Content search now includes page text.

  • 01 Split PreviewEdit Raw beside the actual Hugo-rendered page. Save updates the preview after Hugo rebuilds.
  • 02 Duplicate PageCreate an independent draft from an existing page, with a fresh date and cleared URL and publication settings.
  • 03 Save as ArchetypeTurn a page into a reusable Hugo content template.