UNCLASSIFIED - NO CUI

Skip to content

Update dependency gohugoio/hugo to v0.112.0

renovate requested to merge renovate/gohugoio-hugo-0.x into development

This MR contains the following updates:

Package Type Update Change
gohugoio/hugo ironbank-github minor v0.111.3 -> v0.112.0
gohugoio/hugo minor v0.111.3 -> v0.112.0

Dependency Lookup Warnings

Warnings were logged while processing this repo. Please check the logs for more information.


Release Notes

gohugoio/hugo

v0.112.0

Compare Source

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.json, 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
Documentation

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about these updates again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Merge request reports