Skip to main content

Hugo 0.165.0

Release Date: August 12, 2026

I upgraded a production Hugo site to 0.165.0 the day it shipped (August 12, 2026), and I've been poking at the new template functions all morning. Verdict up front: this release is a sleeper hit for anyone who hand-rolls CSS pipelines. The new css.ChromaStyles and importContext pair is the kind of quality-of-life jump that doesn't make the release blog but saves you an afternoon.

The Headline: css.ChromaStyles

Syntax highlighting stylesheets are now a one-liner. You can generate light and dark Chroma themes directly in your templates:

{{ $light := css.ChromaStyles (dict "targetPath" "css/components/chroma-light.css" "style" "github" "mode" "light") }}
{{ $dark := css.ChromaStyles (dict "targetPath" "css/components/chroma-dark.css" "style" "github" "mode" "dark") }}

No more maintaining a hand-copied highlight.css that drifts from your actual theme. The classDark and classLight options let you style both modes from one pipeline.

importContext: The Quiet MVP

This one took me a minute to appreciate. importContext works across css.Build, js.Build, css.Sass, and css.PostCSS, and it lets resources built from resources.FromString resolve inside CSS @import statements. In plain English: the CSS you generate programmatically can now import other generated CSS without file-path gymnastics. I wired up a multi-theme setup in about ten minutes that used to take a whole build script.

The Fixes That Matter

  • macOS atomic-save panic fixed — that crash when your editor did atomic saves during hugo server? Gone.
  • Static file deletions detected properly — deleting a file from static/ no longer leaves ghost routes in the dev server.
  • Resource transformation chaining restored — chained transforms after content access work again.
  • Asciidoctor TOC parsing fixed — for the html5s backend.

One Config Change to Watch

Hugo removed tailwindcss from the default security.exec.allow list. If you shell out to Tailwind from your build, you'll need to add it back explicitly. It's a security hardening move, but it will break builds silently if you're not paying attention.

Worth It?

Yes — update. The Chroma and importContext features are genuinely useful, the panic fix alone justifies the bump on macOS, and the security list change is better handled now than during a surprise CI failure. brew upgrade hugo and go.

What is New?

By continuing to use the site, you agree to the use of cookies.