v0.159.1

gohugoio/hugov0.159.1Mar 26, 2026by bep

AI Summary

Fixes a regression where the SVG minifier stripped namespace attributes required by libraries like AlpineJS.

Key Highlights

  • Fix SVG minifier stripping `x-bind` and blank namespace attributes.
  • Introduce `keepNamespaces` configuration option for SVG minifiers.

Full Release Notes

The regression fixed in this release isn't new, but it's so subtle that we thought we'd release this sooner rather than later. For some time now, the minifier we use have stripped namespaced attributes in SVGs, which broke dynamic constructs using e.g. [AlpineJS' x-bind:](https://alpinejs.dev/directives/bind) namespace (library used by Hugo's [documentation site](https://gohugo.io/)).

To fix this, the upstream library has hadded a `keepNamespaces` slice option. It was not possible to find a default that would make all happy, so we opted for an option that at least would make AlpineJS sites work out of the box:

```toml
 [minify.tdewolff.svg]
      keepNamespaces = ['', 'x-bind']
```

## What's Changed

* minifiers: Keep x-bind and blank namespace in SVG minification 42289d76 @bep #14669