Skip to content

Releases: gohugoio/hugo

v0.154.1

01 Jan 17:53
@bep bep

Choose a tag to compare

What's Changed

  • Add WASM licensing information to README 8f3527f @bep
  • Fix partial decorator detection in partial with blocks with outer range break or continue 09048aa @bep #14333

v0.154.0

31 Dec 14:25
@bep bep

Choose a tag to compare

Hugo v0.154.0 is the 14th release this year (not counting patch releases) and introduces partial decorators, or “partials with a twist.” This is a very powerful construct that I, @bep, have always wanted to have in Hugo, but I could never wrap my head around an implementation. Until now.

A small and not very useful example:

{{ with partial "b.html" "World" }}Hello {{ . }}{{ end }}
{{ define "_partials/b.html" }}<b>{{ inner . }}</b>{{ end }}

The above renders to:

<b>Hello World</b>
  • The new inner keyword can be used zero or more times in a partial template, typically with different data (e.g. pages in a range), and its presence signals a reversal of the execution -- the callee becomes the caller.
  • Decorators can be deeply nested, see this PR for an example.

This release also brings some new utility funcs in the reflect package to identify the core types in Hugo. For example, to identify an processable image hasn't been trivial, now it is:

{{ $obj := . }}
{{ if reflect.IsResource $obj }}
   {{ if reflect.IsImageResource $obj }}
        // It has width/height and we can process it.
   {{ else }}
       // Just link to it.
   {{ end }}
{{ end }}

Bug fixes

Improvements

Dependency Updates

  • build(deps): bump github.com/tetratelabs/wazero from 1.10.1 to 1.11.0 2637aa1 @dependabot[bot]

v0.153.5

30 Dec 10:48
@bep bep

Choose a tag to compare

What's Changed

v0.153.4

28 Dec 21:58
@bep bep

Choose a tag to compare

What's Changed

  • Set cascade target to the content matrix if not set in the cascade itself 96777d9 @bep #14310

v0.153.3

26 Dec 16:38
@bep bep

Choose a tag to compare

What's Changed

v0.153.2

22 Dec 18:25
@bep bep

Choose a tag to compare

What's Changed

v0.153.1

20 Dec 15:42
@bep bep

Choose a tag to compare

Note

This is a bug fix release. See the main release for a list of new features.

v0.153.0

19 Dec 11:46
@bep bep

Choose a tag to compare

Note

There is a newer bug fix release available here.

This is a good one! Hugo v0.153.0 comes with a powerful new multidimensional content model (languages, versions and roles) and completely overhauls WebP image support, and much more:

  • For the new multidimensional content model, start reading sites matrix and sites complements. The matrix is what gets written to disk, complements allows e.g. a site in Swedish to fill in missing gaps in the site in Norwegian's page and resource collections. Also see the new Rotate method, that allows you to rotate the content tree in a given dimension.
  • For WebP we now build a WASM version of libwebp (v1.6.0) and run it in the Wazero runtime. We use this for both encoding and decoding. This solves an old and annoying issue with Go's stdlib's decoder, with loss of contrast and muted colors in some photos, but it also means that you don't need the extended version of Hugo to handle WebP images. And, drum roll, we now also support animated WebP, including converting to and from animated GIFs.
  • For MacOS, we now build signed and notarised pkg installers.

Also:

Notes

  • tpl/css: Deprecate libsass in favor of dartsass (note) 9937a5d @bep #14261
  • Build Order: Hugo builds sites based on the sorted dimensions (see below). In earlier versions, we built the sites starting with the default content language. This change is also reflected in the sort order of .Site.Sites to make it consistent with .Site.Languages.
  • Sort Order: The dimensions are sorted as follows, which affects build order and complement selection:
    • languages: By weight, then by name.
    • versions: By weight, then by semantic versioning (descending).
    • roles: By weight, then by name.
  • Deprecations:
  • Logging: We no longer log warnings about potential duplicate content paths, as this becomes impractical to reason about with a
    complex sites matrix.

Bug fixes

Improvements

Dependency Updates

  • build(deps): bump github.com/goccy/go-yaml from 1.19.0 to 1.19.1 39649dc @dependabot[bot]
  • build(deps): bump github.com/alecthomas/chroma/v2 from 2.21.0 to 2.21.1 614fb16 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront 33542d3 @dependabot[bot]
  • deps: Upgrade github.com/alecthomas/chroma/v2 v2.20.0 => v2.21.0 588d20b @bep #14266
  • build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.40.1 to 1.41.0 b337302 @dependabot[bot]
  • build(deps): bump github.com/evanw/esbuild from 0.27.1 to 0.27.2 e6a3f1d @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.33.0 to 0.34.0 364d237 @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.39.0 to 0.40.0 079f3eb @dependabot[bot]
  • build(deps): bump github.com/tdewolff/minify/v2 from 2.24.7 to 2.24.8 4e6f2b6 @dependabot[bot]
  • build(deps): bump gocloud.dev from 0.43.0 to 0.44.0 dff5e16 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront c82a035 @dependabot[bot]
  • build(deps): bump github.com/evanw/esbuild from 0.27.0 to 0.27.1 86b01ed @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.40.0 to 1.40.1 9e7182e @dependabot[bot]
  • build(deps): bump github.com/spf13/cobra from 1.9.1 to 1.10.2 cf3ad62 @dependabot[bot]
  • build(deps): bump github.com/goccy/go-yaml from 1.18.0 to 1.19.0 bf42138 @dependabot[bot]
  • build(deps): bump github.com/olekukonko/tablewriter from 1.1.1 to 1.1.2 57fecb6 @dependabot[bot]
  • build(deps): bump github.com/JohannesKaufmann/html-to-markdown/v2 6d0ab6a @dependabot[bot]
  • b...
Read more

v0.152.2

24 Oct 15:47
@bep bep

Choose a tag to compare

In v0.152.0 we tightened the source validation for file mounts. We always said that project mounts can mount with absolute file/directorynames, modules/themes are restricted to relative. In v0.152.0 we narrowed module/themes mounts to be local, which made the setup in the bug report listed below fail:

[[module.mounts]]
source = '../../node_modules/bootstrap'
target = 'assets/vendor/bootstrap'

One part of this is security. But the construct above is usually very odd (the project uses files in a theme/module, not the other way around) and not very portable. But the example above demonstrates a valid exception, that we now have added support for in a portable way. The above example now works as it did before v0.152.0, but going forward you can also write:

[[module.mounts]]
source = 'node_modules/bootstrap'
target = 'assets/vendor/bootstrap'

We now have the node_modules as a special case: For themes/modules we first check if the mounted source exists locally, if not we try relative to the project root.

What's Changed

v0.152.1

22 Oct 19:27
@bep bep

Choose a tag to compare

These fixes are are all related to the YAML library upgrade in v0.152.0.