New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notes release notes 0.112.0 #10947
Comments
@jmooring and others; I have boldly merged #10602. I have tested it well (even added a new end-to-end set of test scripts: https://github.com/gohugoio/hugo/tree/master/testscripts/commands), but the change set is so big that I just assume I have gotten something wrong1. The few functional changes are listed above. I will ask on the forum for some test help (as in: verify that your site(s) and workflow work as expected), and let this sit for a few days before I consider doing the first beta in Hugo's history ... If you find some issues or have any question, just add comment(s) below. Footnotes
|
hugo v0.112.0-DEV-241b21b
This construct worked in earlier versions:
|
Building Hugo$ go version go version go1.20.4 darwin/arm64 $ go install --tags extended github.com/bep/golibsass/internal/libsass Testing HugoProblem flag --gc$ ../../../go/bin/hugo server --gc --verbose --navigateToChanged 2023/05/16 18:57:05 command error: unknown flag: --gc Problem building web siteLatest official hugo = OK $ hugo server --verbose --navigateToChanged hugo v0.111.3+extended darwin/amd64 BuildDate=unknown hugo dev = KO $ ../../../go/bin/hugo server --verbose --navigateToChanged Start building sites … Faulty code is : {{- range .Site.Authors }}{{ with .Social.facebook }}
<meta property="article:author" content="https://www.facebook.com/{{ . }}" />{{ end }}{{ with .Site.Social.facebook }}
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />{{ end }}
<meta property="article:section" content="{{ .Section }}" />
{{- with .Params.tags }}{{ range first 6 . }}
<meta property="article:tag" content="{{ . }}" />{{ end }}{{ end }}
{{- end }}{{ end }} |
@ghk-arolla thanks for this; I will fix it -- this comes from me now defining a |
@bep no problem. Let me know if you want further testing (here is @divinerites multi accounting) |
$ ../../../go/bin/hugo server --verbose --navigateToChanged Start building sites … #### Netlify redirects from aliases
{{- $entries := slice }}
# For Pages in ALL languages + Sections
{{/* remove duplicate Aliases because of mount FR+EN */}}
{{ range $p := site.AllPages -}}
{{ range .Aliases -}}
{{- if not (in $entries .) -}}
{{ . | printf "%-35s" }} {{ $p.RelPermalink }}?utm_source=redirect_aliases 301!
{{- $entries = $entries | append . }}
{{ end -}}
{{ end -}}
{{- end }} |
.Site.Authors has never been functional; it was never fully implemented. Seems like a good time to break some eggs. |
Building the Let's Encrypt repo:
I don't know why they used this instead of Unfortunately, I've seen a lot of this (which works in v0.111.3):
Instead of this:
|
Maybe because this is how frontmatter works. People try it in other places and if it used to work… |
Building https://github.com/frjo/xdeb-org with I get a number of this error: ERROR 2023/05/16 20:19:58 render of "page" failed:
"…/xdeb/themes/zen/layouts/_default/baseof.html:28:6":
execute of template failed: template:
_default/single.html:28:6: executing "_default/single.html" at <site>:
can't evaluate field IsMultiLingual in type interface {} The code looks like this:
Works without issue in Update: It only fails if the site is not multilingual. |
This code fails on
|
Both of the sites below build without error with v0.111.3. Building https://github.com/kubernetes/website/
Building https://github.com/seleniumHQ/seleniumhq.github.io/
Both of these site use the docsy theme, which defines the "print" output format in its hugo.toml file. The "unknown output format" error occurs before Hugo can download the module. If you comment the Also, please note that the message is not preceded by the word ERROR, so I didn't catch it the first couple of build attempts. |
I will mark these as deprecated in the code and break the egg in the next release, but I agree with the general idea -- but just failing hard like this would create more noise than good is. Thanks for the testing/feedback all!
Hmm ... |
@ghk-arolla good catch, seems there was some holes in my flag handling, good thing it should be easy to fix. |
@jmooring yea, I get the same error; I will fix it. Edit in, the reason it fails is that we do a 2 pass reading of the config:
I will try to wrap my head around how to fix this. |
As in: Get the Kubernetes site to build with the new Hugo version. Updates gohugoio#10947
As in: Get the Kubernetes site to build with the new Hugo version. Updates gohugoio#10947
Never mind, the above was the |
As in: Get the Kubernetes site to build with the new Hugo version. Updates gohugoio#10947
As in: Get the Kubernetes site to build with the new Hugo version. Updates #10947
@ghk-arolla the compilation warning is know (and now new) and we have an issue about it. As to the other issues in this thread, they should now be fixed, see #10948 |
Compilation of #10948 ✅
WARN 2023/05/17 22:26:47 config: languages.fr.copyrighttheme1: custom params on the language top level is deprecated and will be removed in a future release. Put the value below [languages.fr.params]. See See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120 ... A LOT of such warning ... Re-run Hugo with the flag --panicOnWarning to get a better error message.
See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120 Re-run Hugo with the flag --panicOnWarning to get a better error message. |
In your case I would assume it looks something like this: [en]
title = "Site title in English"
copyrighttheme1 = "come copyright theme" With the above I think it's important for people to understand what's Site/Language config and what's custom params, so: [en]
title = "Site title in English"
[en.params]
copyrighttheme1 = "come copyright theme" Should be your fix. |
Ahhhhhhhh .... obvious now .... Sorry. Will try a branch with those 112.0 fix and come back |
@ghk-arolla but note that the above construct is also great in Hugo 0.111.x; it's what the documentation says and what I expected most people would do (before I opened up this issue). |
$ ../../../go/bin/hugo --gc
Start building sites …
hugo v0.112.0-DEV-35955f50e6c82b33f3321fa3cbf8f03bdd0cc4a5+extended darwin/arm64 BuildDate=2023-05-17T20:14:15Z
WARN 2023/05/17 23:11:11 .Language.Params is deprecated and will be removed in a future release. .Language.Params is deprecated and will be removed in a future release. Use site.Params instead.
- For all but custom parameters, you need to use the built in Hugo variables, e.g. site.Title, site.LanguageCode; site.Language.Params.Title will not work.
- All custom parameters needs to be placed below params, e.g. [languages.en.params] in TOML.
See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120
Re-run Hugo with the flag --panicOnWarning to get a better error message.
ERROR 2023/05/17 23:11:11 render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/our-events.html:38:7": execute of template failed: template: _default/our-events.html:38:7: executing "_default/our-events.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {}
ERROR 2023/05/17 23:11:11 render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/baseof.html:38:7": execute of template failed: template: _default/offres.html:38:7: executing "_default/offres.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {}
ERROR 2023/05/17 23:11:11 render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/baseof.html:38:7": execute of template failed: template: _default/our-rooms.html:38:7: executing "_default/our-rooms.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {}
ERROR 2023/05/17 23:11:11 render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/baseof.html:38:7": execute of template failed: template: _default/arolla-experiences.html:38:7: executing "_default/arolla-experiences.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {}
Error: error building site: render: failed to render pages: render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/baseof.html:38:7": execute of template failed: template: _default/arolla-therapie.html:38:7: executing "_default/arolla-therapie.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {}
Total in 465 ms
2023/05/17 23:11:11 error building site: render: failed to render pages: render of "page" failed: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/_default/baseof.html:38:7": execute of template failed: template: _default/arolla-therapie.html:38:7: executing "_default/arolla-therapie.html" at <partial "essentials/header.html" .>: error calling partial: "/Users/xxx/Documents/Git/ghk-2022/themes/grandhotel/layouts/partials/essentials/header.html:78:21": execute of template failed: template: partials/essentials/header.html:78:21: executing "partials/essentials/header.html" at <site>: can't evaluate field LanguagePrefix in type interface {} languages.tomlDetails
|
@ghk-arolla re. LanguagePrefix, see 86b2a27 -- as to the others, try |
✅ build against Previous error gone. Other are still here. Will make the changes. Forget my previous report here. I'm just stupid. [EDIT] I had to change also 2 |
$ ../../../go/bin/hugo --panicOnWarning
-------------------+------+------ Total in 1747 ms |
3 others sites compile fine with the warnings ... |
Let's take further issues about this here: #10953 |
On my end 8 out of 9 Hugo projects generated with no warning. The 9th project got a In my other multilingual projects I generate the homepage Also I am no longer having the macOS error mentioned in #10491 So the commit that closed that issue works fine on my end also. P.S. Is there another way to subscribe to critical updates like this one without having to rely on the forum or having to follow this repo? I'm wondering as I'm pretty busy these past few months and I only saw the announcement about these potentially breaking changes by accident. If there is a way to get crucial notifications please let me know. |
@onedrawingperday thanks for this, re. description, I think you have found a bug, as I'm pretty sure we have had a top level
You can subscribe to the release feed here on GitHub, but there's no alert system other than that. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Notes
TailwindCSS 3 Support, new cache buster configuration
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 withhugo server --debug
and watch out for log messages prefixed withcachebuster:
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.And then in
tailwind.config.js
:See https://github.com/bep/hugo-starter-tailwind-basic for an example.
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 intohugo.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 languageen
you will now get:In earlier versions of Hugo you would get:
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:You can now also configure just about everything per language. One useful example would be the Goldmark
typographer
extension: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:The text was updated successfully, but these errors were encountered: