Releases: gohugoio/hugo
v0.112.7
v0.112.6
- github: Fix Windows build 06faee5 @bep #11052
- Fix potential deadlock in ByParam 3258569 @bep #11039
- commands: Add --lang to hugo config 0ef2952 @bep #11057
- Make sure any default mounts show up in "hugo config" e3ae8f0 @bep #11040
- tpl/tplimpl: Use .Language.LanguageCode in built-in templates ff77a92 @jmooring
- Fail on invalid defaultContentLanguage 9cdca1f @bep #11044
- Avoid panic in invalid language config 6462eec @bep #11046
- Don't panic on empty yaml config params a7d6b14 @bep #11047
- Prevent double escaping of image alt-text in Goldmar typographer 3f497d4 @bep #11045
- deps: Update github.com/tdewolff/minify/v2 v2.12.5 => v2.12.6 409c6c3 @jmooring
v0.112.5
v0.112.4
- Fix Processed images count regression for multiple languages fd09933 @bep #11002
- Fix --renderStaticToDisk regression 8f293a1 @bep #11026
- commands: Add the common build flags to the config commands 51d0a0a @bep #11018
- commands: Reinstate some of the removed build flags (e.g. --theme) to new and mod 43f1282 @bep #11018
- Don't create the public folder unless needed e96cdfe @bep #11031
- commands: Fail the build when no config file or config dir 273d9f6 @bep #11019
- langs: Remove the Language.Params deprecation message for now a6257d8 @bep #11025
- Add language.LanguageCode 6c2db0d @bep #11027
- commands: Re-introduce the -f shorthand for hugo new site 901cd97 @bep #11015
- commands: Move the --format flag to only the commands that support it f86b5f7 @bep #11022
Documentation
v0.112.3
v0.112.2
v0.112.1
v0.112.0
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
- 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 288be19 @bep #10953
- commands: Fix build logic when listing expired/future draft content e6dc805 @bep #10972
- commands: Fix data race 0a51dfa @bep #10953
- tpl/urls: Fix build broken by a merge e4e0313 @bep
- Fix warn message about custom params on the language top level ad4bc96 @deining
- Fix some spelling mistakes 4003c79 @cuishuang
- all: Fix comments for exported functions and packages 610ceda @alexandear
- modules: Fix format flag in error 95818e2 @alexandear
- Fix some recently introduced error handling issues 834b3d7 @bep #10953
- Re-add site.LanguagePrefix 86b2a27 @bep #10947
- Deprecate site.Language.Params and some other fixes 5d85716 @bep #10947
- readme: Fix build command d01731d @kirisakow
- resources: Fix typos in error message and variables 891b291 @alexandear
- commands: Fix data race in test 0fbab7c @bep
Improvements
- circleci: Add github.com to known hosts 70b2aaf @bep
- Add --format to hugo config 85b13c1 @bep
- postcss: Improve validation of option 'config' 9a0370e @deining
- Avoid writing to hugo_stats.json when there are no changes 4cac5f5 @bep #10985
- Add cache busting config to support Tailwind 3 2c3d4df @bep #10974
- commands: Make all list commands list what 'all' did before 6ca8a40 @bep #10953
- tpl/tplimpl: Add img loading attribute to figure shortcode (#10927) 2db7ec6 @InLaw
- Allow whitelisting mediaTypes used in resources.GetRemote 2637b4e @bep #10286
- Add hugo.WorkingDir 7c7baa6 @bep #10969
- Make language merging of markup etc. config without values in the root 4f085e8 @bep #10953
- tpl/urls: Return empty string when JoinPath has zero args 150d190 @jmooring
- Re-add --printUnusedTemplates and --printPathWarnings d6197a4 @bep #10953
- tpl/urls: Add JoinPath template function 5b3e165 @jmooring #9694
- Allow legacy taxonomyTerm in disableKinds 03cb38e @bep #10953
- Make GOMAXPROCS to be CPU limit aware 008170c @BenTheElder #10950
- Allow empty params.mainSections 7c647bc @bep #10953
- commands: Load config before creating the filesystem 3f00f47 @bep
- github: Trim the test flow a little 35955f5 @bep
- commands: Improve the common build flag handling 8a69ccb @bep #10947
- Support, but warn, about top level language custom params 7ce033a @bep #10947
- Handle transient errors in config loading etc. 0554213 @bep #10947
- Re-establish all the server flags 5251f01 @bep #10947
- Revert "Make GOMAXPROCS CPU limit aware" 0106cf1 @bep
- Make GOMAXPROCS CPU limit aware 59050f9 @BenTheElder #10950
- Add Sections to Site interface faa6998 @bep #10947
- helpers: simplify path tests with T.TempDir 3d90871 @alexandear
- tpl: Add math.Abs bda082c @alexandear #10941
- Create a struct with all of Hugo's config options 241b21b @bep #10896 #10620
- Improve date parsing performance for the common case 6aededf @bep #10942
- Add a counter helper 0988b76 @bep
- Expand the baseline benchmark a little e0e19a9 @bep
- Revert "Update syntax-highlighting.md (#10929)" (#10930) bcd7ac7 @jmooring
- Update syntax-highlighting.md (#10929) a4fb8dc @kirillbobyrev
- tpl/strings: Clarify findRESubmatch description 5c7b79c @jmooring
- langs/i18n: Fallback to defaultContentLanguage instead of English 0cb6ca5 @jmooring #9216
- tpl/debug: Add VisualizeSpaces f106251 @bep
- Prevent the global error collector to panic when sending on closed channel 9906c1a @bep
- markup/goldmark: Add config options for the typographer extension 5596dc2 @bep #9772
- Add test for ToC vs include 5748133 @bep #10866
- resources.functions: improve validation 05c095a @deining
- markup/goldmark: Fail on invalid Markdown attributes b0b1b76 @bep
- tpl/math: Return error if less than 2 input numbers f5eddf8 @septs #10827
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)...
v0.111.3
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
- tpl: Add hasSuffix alias d171d15 @jfish2
- Run gofmt -s on source files d55af2a @deining
- tpl/math: Allow multi numbers in add, sub, mul, div, min and max 84201e8 @septs
- server: Replace golang.org/x/net/context with context 0f01bd4 @alexandear
- watcher: use time.NewTicker to prevent leaks 02ab77d @alexandear
- ensure we default to 10 correctly 873be9f @davidejones
- switch transfers to workers bebb2b8 @davidejones
- customize parallel transfer count e6f029b @davidejones
- metadecoders: Add support for native org dates in frontmatter PR #7433 added support for Org timestamps for the DATE header. This PR widens the support with additional front matter headers LASTMOD, PUBLISHDATE and EXPIRYDATE. bdbfacb @johannesengl #8536
Dependency Updates
- deps: Update go-org to v1.6.6 1c841ec @niklasfasching
Documentation
v0.111.2
Bug fixes
- Fix .Fragments when called cross sites on uninitialized output format b83050c @bep #10794
- Fix "context canceled" with partial 3bbeb56 @bep #10789
- cache: Fix --gc failure on Windows 184a67a @alexandear
- snap: Fix dart-sass-embedded installation a950950 @jmooring #10783
- Allow page.TableOfContents on self in shortcode df5608f @bep #10791
- Page context handling in i18n 6c798eb @bep #10782
- Work around --gc failure on Windows <= 10 ec1c97e @bep #10781
- Correct typos in Go comments 36ce3a4 @alexandear