>**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](https://github.com/bep/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.
toml
[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`:
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](https://github.com/bep/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:
json
"comments": {
"color": "blue",
"title": "English Comments Title",
}
In earlier versions of Hugo you would get:
json
"comments": {
"title": "English Comments Title",
}
toml
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:
toml
[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:
toml
[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
* openapi2: .ExtensionProps is now .Extensions and just a map.
* We have deprecated `site.Language.Params` and configuration of custom params outside of the language `[params]`, see https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120 for more information.
Bug fixes
* Fix "unknown command" message when no suggestion 288be197 bep 10953
* commands: Fix build logic when listing expired/future draft content e6dc8053 bep 10972
* commands: Fix data race 0a51dfac bep 10953
* tpl/urls: Fix build broken by a merge e4e0313c bep
* Fix warn message about custom params on the language top level ad4bc969 deining
* Fix some spelling mistakes 4003c790 cuishuang
* all: Fix comments for exported functions and packages 610cedaa alexandear
* modules: Fix format flag in error 95818e27 alexandear
* Fix some recently introduced error handling issues 834b3d7e bep 10953
* Re-add site.LanguagePrefix 86b2a274 bep 10947
* Deprecate site.Language.Params and some other fixes 5d857165 bep 10947
* readme: Fix build command d01731d5 kirisakow
* resources: Fix typos in error message and variables 891b2918 alexandear
* commands: Fix data race in test 0fbab7cb bep
Improvements
* circleci: Add github.com to known hosts 70b2aaf8 bep
* Add --format to hugo config 85b13c10 bep
* postcss: Improve validation of option 'config' 9a0370e8 deining
* Avoid writing to hugo_stats.json when there are no changes 4cac5f5e bep 10985
* Add cache busting config to support Tailwind 3 2c3d4dfb bep 10974
* commands: Make all list commands list what 'all' did before 6ca8a40f bep 10953
* tpl/tplimpl: Add img loading attribute to figure shortcode (10927) 2db7ec62 InLaw
* Allow whitelisting mediaTypes used in resources.GetRemote 2637b4ef bep 10286
* Add hugo.WorkingDir 7c7baa61 bep 10969
* Make language merging of markup etc. config without values in the root 4f085e80 bep 10953
* tpl/urls: Return empty string when JoinPath has zero args 150d190f jmooring
* Re-add --printUnusedTemplates and --printPathWarnings d6197a41 bep 10953
* tpl/urls: Add JoinPath template function 5b3e165b jmooring 9694
* Allow legacy taxonomyTerm in disableKinds 03cb38e6 bep 10953
* Make GOMAXPROCS to be CPU limit aware 008170c8 BenTheElder 10950
* Allow empty params.mainSections 7c647bca bep 10953
* commands: Load config before creating the filesystem 3f00f475 bep
* github: Trim the test flow a little 35955f50 bep
* commands: Improve the common build flag handling 8a69ccbb bep 10947
* Support, but warn, about top level language custom params 7ce033a8 bep 10947
* Handle transient errors in config loading etc. 05542130 bep 10947
* Re-establish all the server flags 5251f015 bep 10947
* Revert "Make GOMAXPROCS CPU limit aware" 0106cf1a bep
* Make GOMAXPROCS CPU limit aware 59050f97 BenTheElder 10950
* Add Sections to Site interface faa6998f bep 10947
* helpers: simplify path tests with T.TempDir 3d90871e alexandear
* tpl: Add math.Abs bda082c9 alexandear 10941
* Create a struct with all of Hugo's config options 241b21b0 bep 10896 10620
* Improve date parsing performance for the common case 6aededf6 bep 10942
* Add a counter helper 0988b76a bep
* Expand the baseline benchmark a little e0e19a93 bep
* Revert "Update syntax-highlighting.md (10929)" (10930) bcd7ac77 jmooring
* Update syntax-highlighting.md (10929) a4fb8dc6 kirillbobyrev
* tpl/strings: Clarify findRESubmatch description 5c7b79cf jmooring
* langs/i18n: Fallback to defaultContentLanguage instead of English 0cb6ca59 jmooring 9216
* tpl/debug: Add VisualizeSpaces f1062519 bep
* Prevent the global error collector to panic when sending on closed channel 9906c1ae bep
* markup/goldmark: Add config options for the typographer extension 5596dc24 bep 9772
* Add test for ToC vs include 5748133d bep 10866
* resources.functions: improve validation 05c095a0 deining
* markup/goldmark: Fail on invalid Markdown attributes b0b1b76d bep
* tpl/math: Return error if less than 2 input numbers f5eddf89 septs 10827
Dependency Updates
* Revert "build(deps): bump gocloud.dev from 0.24.0 to 0.29.0" f0149211 bep 10993
* build(deps): bump github.com/tdewolff/parse/v2 from 2.6.5 to 2.6.6 1292d5a2 dependabot[bot]
* build(deps): bump gocloud.dev from 0.24.0 to 0.29.0 baa55690 dependabot[bot]
* build(deps): bump github.com/gobuffalo/flect from 0.3.0 to 1.0.2 a5413c1f dependabot[bot]
* build(deps): bump golang.org/x/image from 0.5.0 to 0.7.0 9cea58a8 dependabot[bot]
* build(deps): bump github.com/tdewolff/minify/v2 from 2.12.4 to 2.12.5 1a5dce4c dependabot[bot]
* build(deps): bump github.com/dustin/go-humanize from 1.0.0 to 1.0.1 065ae003 dependabot[bot]
* build(deps): bump google.golang.org/api from 0.76.0 to 0.123.0 1a7d57c0 dependabot[bot]
* build(deps): bump golang.org/x/tools from 0.4.0 to 0.9.1 bba54e69 dependabot[bot]
* build(deps): bump github.com/cli/safeexec from 1.0.0 to 1.0.1 73705431 dependabot[bot]
* build(deps): bump github.com/getkin/kin-openapi from 0.110.0 to 0.117.0 f6269ee9 dependabot[bot]
* deps: Update github.com/evanw/esbuild v0.17.0 => v0.17.19 715d4840 bep
* deps: Update github.com/alecthomas/chroma/v2 v2.7.0 c371171a bep
* deps: Update github.com/bep/golibsass v1.1.0 => v1.1.1 24e7d0c1 bep 10629 10491
Documentation
* docs: Regen docshelper b6e6438f bep
* commands: Add missing gen docshelper command 943ff7f7 bep 10953
* docs: Regen CLI docs 10d0fcc0 bep
* tpl/lang: document delimiter option for FormatNumberCustom 1155bbca jmooring
* Update README.md 4f341fa1 bep
* Update README.md 46a3cf61 bep
* Update README.md f1e8f010 bep