Skip to content

Releases: gohugoio/hugo

v0.161.1

29 Apr 14:38
@bep bep

Choose a tag to compare

What's Changed

v0.161.0

28 Apr 13:55
@bep bep

Choose a tag to compare

This release contains two security hardening fixes:

  • We now run the Node tools PostCSS, Babel and TailwindCSS, by default, with the --permission flag with the permissions defined in security.node.permissions. This means that you need Node >= 22 installed and that css.TailwindCSS now requires that the Tailwind CSS CLI must be installed as a Node.js package. The standalone executable is no longer supported
  • We have made the defaults in security.http.urls more restrictive.

But there are some notable new features, as well:

Nested vars support in css.Build and css.Sass

A practical example in css.Build would be to have something like this in hugo.toml:

[params.style]
    primary    = "#000000"
    background = "#ffffff"
    [params.style.dark]
        primary    = "#ffffff"
        background = "#000000"

And in the stylesheet:

@import "hugo:vars";
@import "hugo:vars/dark" (prefers-color-scheme: dark);

:root {
  color-scheme: light dark;
}

Slice-based permalinks config

The permalinks configuration is now much more flexible (the old setup still works). It uses the same target matchers as in the cascade config, meaning you can now do:

permalinks:
  - target:
      kind: page
      path: "/books/**"
    pattern: /books/:year/:slug/
  - target:
      kind: section
      path: "/{books,books/**}"
    pattern: /libros/:sections[1:]
  - target:
      kind: page
    pattern: /other/:slug/

The above example isn't great, but it at least shows the gist of it.

A more flexible scheme for identifiers in filenames

What we had before was e.g. content/mypost.en.md which told Hugo that the content files was in English. With the new setup you could also name the file content/mypost._language_en_.md. This alone doesn't sound very useful, but this allows you to use more prefixes:

Prefix Description Relevant for
language_ Language Content and layout files.
role_ Role Content and layout files.
version_ Version Content and layout files.
outputformat_ Output format Layout files.
mediatype_ Media type Layout files.
kind_ Page kind Layout files.
layout_ Layout Layout files.

All Changes

v0.160.1

08 Apr 14:23
@bep bep

Choose a tag to compare

What's Changed

v0.160.0

04 Apr 14:17
@bep bep

Choose a tag to compare

Now you can inject CSS vars, e.g. from the configuration, into your stylesheets when building with css.Build. Also, now all the render hooks has a .Position method, now also more accurate and effective.

Bug fixes

Improvements

Dependency Updates

  • build(deps): bump github.com/magefile/mage from 1.16.1 to 1.17.1 bf6e35a @dependabot[bot]
  • build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.3 to 4.1.4 0eda24e @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.37.0 to 0.38.0 beb57a6 @dependabot[bot]

Documentation

  • readme: Revise edition descriptions and installation instructions 9f1f1be @jmooring

v0.159.2

01 Apr 14:42
@bep bep

Choose a tag to compare

Note that the security fix below is not a potential threat if you either:

EDIT IN: This release also adds release archives for non-extended-withdeploy builds.

What's Changed

  • Fix potential content XSS by escaping dangerous URLs in Markdown links and images 479fe6c @bep
  • resources/page: Fix shared reader in Source.ValueAsOpenReadSeekCloser df520e3 @jmooring #14684

v0.159.1

26 Mar 10:18
@bep bep

Choose a tag to compare

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: namespace (library used by Hugo's documentation site).

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:

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

What's Changed

v0.159.0

23 Mar 18:36
@bep bep

Choose a tag to compare

This release greatly improves and simplifies management of Node.js/npm dependencies in a multi-module setup. See this page for more information.

Note

  • Replace deprecated site.Data with hugo.Data in tests a8fca59 @bep
  • Replace deprecated excludeFiles and includeFiles with files in tests 182b104 @bep
  • Replace deprecated :filename with :contentbasename in the permalinks test eb11c3d @bep

Bug fixes

Improvements

Dependency Updates

Documentation

v0.158.0

16 Mar 18:07
@bep bep

Choose a tag to compare

This release adds css.Build, native and very fast bundling/transformation/minifying of CSS resources. Also see the new strings.ReplacePairs, a very fast option if you need to do many string replacements.

Notes

Deprecations

The methods and config options are deprecated and will be removed in a future Hugo release.

Also see this article

Language configuration

  • languageCode → Use locale instead.
  • languages.<lang>.languageCode → Use languages.<lang>.locale instead.
  • languages.<lang>.languageName → Use languages.<lang>.label instead.
  • languages.<lang>.languageDirection → Use languages.<lang>.direction instead.

Language methods

  • .Site.LanguageCode → Use .Site.Language.Locale instead.
  • .Language.LanguageCode → Use .Language.Locale instead.
  • .Language.LanguageName → Use .Language.Label instead.
  • .Language.LanguageDirection → Use .Language.Direction instead.

Bug fixes

Improvements

Dependency Updates

v0.157.0

25 Feb 17:00
@bep bep

Choose a tag to compare

The notable new feature is GitInfo support for Hugo Modules. See this repo for a runnable demo where multiple versions of the same content is mounted into different versions.

Bug fixes

Improvements

Dependency Updates

  • build(deps): bump github.com/tdewolff/minify/v2 from 2.24.8 to 2.24.9 9869e71 @dependabot[bot]
  • build(deps): bump github.com/bep/imagemeta from 0.14.0 to 0.15.0 8f47fe8 @dependabot[bot]

v0.156.0

18 Feb 17:21
@bep bep

Choose a tag to compare

This release brings significant speedups of collections.Where and collections.Sort – but this is mostly a "spring cleaning" release, to make the API cleaner and simpler to understand/document.

Deprecated

  • Site.AllPages is Deprecated
  • Site.BuildDrafts is Deprecated
  • Site.Languages is Deprecated
  • Site.Data is deprecated, use hugo.Data
  • Page.Sites and Site.Sites is Deprecated, use hugo.Sites

See this topic for more info.

Removed

These have all been deprecated at least since v0.136.0 and any usage have been logged as an error for a long time:

Template functions

  • data.GetCSV / getCSV (use resources.GetRemote)
  • data.GetJSON / getJSON (use resources.GetRemote)
  • crypto.FNV32a (use hash.FNV32a)
  • resources.Babel (use js.Babel)
  • resources.PostCSS (use css.PostCSS)
  • resources.ToCSS (use css.Sass)

Page methods:

  • .Page.NextPage (use .Page.Next)
  • .Page.PrevPage (use .Page.Prev)

Paginator:

  • .Paginator.PageSize (use .Paginator.PagerSize)

Site methods:

  • .Site.LastChange (use .Site.Lastmod)
  • .Site.Author (use .Site.Params.Author)
  • .Site.Authors (use .Site.Params.Authors)
  • .Site.Social (use .Site.Params.Social)
  • .Site.IsMultiLingual (use hugo.IsMultilingual)
  • .Sites.First (use .Sites.Default)

Site config:

  • paginate (use pagination.pagerSize)
  • paginatePath (use pagination.path)

File caches:

  • getjson cache
  • getcsv cache

Notes

Bug fixes

Improvements

Dependency Updates

  • build(deps): bump google.golang.org/api from 0.255.0 to 0.267.0 d8ec0ee @dependabot[bot]
  • build(deps): bump github.com/bep/textandbinarywriter 21be4af @dependabot[bot]
  • build(deps): bump github.com/bep/simplecobra from 0.6.1 to 0.7.0 e549016 @dependabot[bot]
  • build(deps): bump github.com/bep/tmc from 0.5.1 to 0.6.0 a392906 @dependabot[bot]
  • build(deps): bump github.com/gohugoio/hugo-goldmark-extensions/extras 86786c9 @dependabot[bot]
  • build(deps): bump github.com/gohugoio/hugo-goldmark-extensions/passthrough 7a7308a @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.41.0 to 0.42.0 2d1d731 @dependabot[bot]
  • build(deps): bump github.com/bep/helpers from 0.6.0 to 0.7.0 b26fbf8 @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.35.0 to 0.36.0 7358309 @dependabot[bot]

Build Setup

Documentation