Skip to content

Releases: gohugoio/hugo

v0.112.6

01 Jun 09:16
@bep bep
Compare
Choose a tag to compare

v0.112.5

29 May 07:42
@bep bep
Compare
Choose a tag to compare

What's Changed

v0.112.4

28 May 13:25
@bep bep
Compare
Choose a tag to compare

Documentation

v0.112.3

24 May 14:54
@bep bep
Compare
Choose a tag to compare

What's Changed

  • Fix regression when loading config -e is empty or HUGO_ENV or HUGO_ENVIRONMENT is set 231374a @bep #11013

v0.112.2

24 May 11:16
@bep bep
Compare
Choose a tag to compare

What's Changed

v0.112.1

23 May 17:42
@bep bep
Compare
Choose a tag to compare

What's Changed

  • Fix regression when config for OutputFormat.BaseName is an empty string ed906a8 @bep #11000

Also see the main release: https://github.com/gohugoio/hugo/releases/tag/v0.112.0

v0.112.0

23 May 08:27
@bep bep
Compare
Choose a tag to compare

Note: There's a patch release out already, see https://github.com/gohugoio/hugo/releases/tag/v0.112.1

Proper TailwindCSS v3.x support, much improved language config merge, consolidation of all Hugo config (check out hugo config), rewritten commands package (CLI) using SimpleCobra, Goldmark's typographer extension (quotation marks per language), and more.

Headlines

TailwindCSS v3.x Support, new cache buster configuration

See https://github.com/bep/hugo-starter-tailwind-basic for a running example.

TailwindCSS 3 has been out for a while now, and unfortunately their new build strategy didn't work very well with Hugo. But this release adds a new build.cachebusters config option for the resource cache that allows more fine grained control over when to trigger a new Tailwind build. This is a generally useful feature, so if you're having issues not seeing your resource changes (e.g. change to a JS file) on change, you could try to tweak the defaults. A tip is to run the server with hugo server --debug and watch out for log messages prefixed with cachebuster: on file changes.

There are several possible setups here, but one that we have tested and that works well is outlined in the config below. The basic concept is to add hugo_stats.json to the server watcher list in Hugo and trigger a new TailwindCSS build only whenever either this file or the main CSS file changes.

[module]
  [[module.mounts]]
    source = "assets"
    target = "assets"
  [[module.mounts]]
    source = "hugo_stats.json"
    target = "assets/watching/hugo_stats.json"

[build]
  writeStats = true
  [[build.cachebusters]]
    source = "assets/watching/hugo_stats\\.json"
    target = "styles\\.css"
  [[build.cachebusters]]
    source = "(postcss|tailwind)\\.config\\.js"
    target = "css"
  [[build.cachebusters]]
    source = "assets/.*\\.(js|ts|jsx|tsx)"
    target = "js"
  [[build.cachebusters]]
    source = "assets/.*\\.(.*)$"
    target = "$1"

And then in tailwind.config.js:

module.exports = {
	content: ['./hugo_stats.json'],
};

Reconsolidated all configuration handling

For this release we have collected all configuration into one big Go struct and rewritten the command line API using SimpleCobra. All of this makes the source code easier to maintain and understand, but the original motivation for this was to get a complete and autogenerated API reference for Hugo (we're working on getting that done), but this also have some less technical upsides:

'hugo config' is now complete

What you get when running hugo config is a complete TOML representation (add --format json or --format yaml for alternative formats) of the effective configuration. As this will include default values and configuration merged in from themes, we don't recommend to copy and paste this into hugo.toml, as that would make your configuration very verbose.

Improved language config handling

See issue #10620 for some details, but in general, the merge behaviour of sections from languages is much improved. In the example below for language en you will now get:

 "comments": {
    "color": "blue",
    "title": "English Comments Title",
}

In earlier versions of Hugo you would get:

 "comments": {
    "title": "English Comments Title",
}
title = "Base Title"
staticDir = "mystatic"
[params]
[params.comments]
color = "blue"
title = "Default Comments Title"
[languages]
[languages.en]
title = "English Title"
[languages.en.params.comments]
title = "English Comments Title"

Note that values in a given language will always have precedence over same keys in root (the section inside the language is the receiving side of any merge operation), so, if you want the old (and buggy) behaviour, you can add a merge strategy to one of the params sections, e.g:

[languages.en.params.comments]
_merge = "none"
title = "English Comments Title"

You can now also configure just about everything per language. One useful example would be the Goldmark typographer extension:

[languages.de]
languageCode = 'de-DE'
languageName = 'Deutsch'
weight = 2
[languages.de.markup.goldmark.extensions.typographer]
leftDoubleQuote = '«'   # default “
rightDoubleQuote = '»'  # default ”

More info in verbose build output

If you build flag with the -v, you will now get timing info for the core building steps in Hugo:

INFO 2023/05/16 09:53:55 process in 17 ms
INFO 2023/05/16 09:53:55 assemble in 345 ms
INFO 2023/05/16 09:53:55 render in 341 ms
INFO 2023/05/16 09:53:55 postProcess in 0 ms

Notes

Bug fixes

Improvements

Dependency Updates

  • Revert "build(deps): bump gocloud.dev from 0.24.0 to 0.29.0" f014921 @bep #10993
  • build(deps): bump github.com/tdewolff/parse/v2 from 2.6.5 to 2.6.6 1292d5a @dependabot[bot]
  • build(deps): bump gocloud.dev from 0.24.0 to 0.29.0 baa5569 @dependabot[bot]
  • build(deps): bump github.com/gobuffalo/flect from 0.3.0 to 1.0.2 a5413c1 @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.5.0 to 0.7.0 9cea58a @dependabot[bot]
  • build(deps): bump github.com/tdewolff/minify/v2 from 2.12.4 to 2.12.5 1a5dce4 @dependabot[bot]
  • build(deps): bump github.com/dustin/go-humanize from 1.0.0 to 1.0.1 065ae00 @dependabot[bot]
  • build(deps): bump google.golang.org/api from 0.76.0 to 0.123.0 1a7d57c @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.4.0 to 0.9.1 bba54e6 @dependabot[bot]
  • build(deps): bump github.com/cli/safeexec from 1.0.0 to 1.0.1 7370543 @dependabot[bot]
  • build(deps)...
Read more

v0.111.3

12 Mar 12:00
@bep bep
Compare
Choose a tag to compare

Bug fixes

  • Fix "unknown shortcode token" when calling shortcode within fenced code block e7148f3 @bep #10819
  • Don't fail when calling Paginate with an empty pages.PagesGroup 34a86e1 @bep #10802
  • Improve error message for unclosed shortcode with inner content 9818724 @deining

Improvements

Dependency Updates

Documentation

v0.111.2

05 Mar 12:43
@bep bep
Compare
Choose a tag to compare

Bug fixes

Documentation

Build Setup

v0.111.1

02 Mar 10:30
@bep bep
Compare
Choose a tag to compare

This fixes the "page" not defined issue in Hugo 0.111.0. eef23a7 @bep #10774