Skip to content
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

[hugo-updater] Update Hugo to version 0.95.0 #54

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

abtris
Copy link
Owner

@abtris abtris commented Mar 21, 2022

[hugo-updater] Update Hugo to version 0.95.0
More details in https://github.com/gohugoio/hugo/releases/tag/v0.95.0

Even faster, continue and break support, short-circuit of the built-in and/or-operators. This release upgrades to Go 1.18 which was released yesterday. This has made Hugo even faster. How much faster will depend on your site etc., but we have benchmarks that show significant improvements. But the main reason we're exited about this is the improvements in Go templates:

There are two new keywords, break and continue. These behaves like you would expect coming from other programming languages:

{{ range $i, $p := site.RegularPages }}
  {{ if gt $i 2 }}
    {{/* Break out of range, we only want to print the first 3 pages. */}}
    {{ break }}
  {{ end }}
  {{ $p.Title }}
{{ end }}
{{ range $i, $p := site.RegularPages }}
  {{ if eq $i 2 }}
    {{/* Skip the 3rd page. */}}
    {{ continue }}
  {{ end }}
  {{ $p.Title }}
{{ end }}

Also, the two built-in operators/function and and or now short-circuits, also in line with how && and || behave in other programming languages. This is useful in situations where the right side may have side effects (may be nil, is slow to execute etc.):

{{ if and .File (eq .File.Extension "html") }}
{{ end }}

Hugo now has:

Notes

  • Hugo now only builds with Go versions >= 1.18. Note that you do not need Go installed to run Hugo, and for Hugo Modules, any recent Go version can be used.

Changes

  • readme: Add note about Go 1.18 5930173c @bep
  • tpl: Pull in Go 1.18 patch that fixes the "no space in {{ continue }} and {{ break }}" bug 3476b533 @bep
  • readme: Add a contribution note e792d270 @bep
  • github: Make it build with Go 1.18 9d6495d7 @bep
  • tpl: Adjustments and an integration test for Go 1.18 42cc5f88 @bep #9677
  • Remove Go 1.17 support a6488e7b @bep #9677
  • tpl: Sync go_templates for Go 1.18 65a78cae @bep #9677
  • build: Bump to Go 1.18 4d6d1d08 @bep #9677
  • dartsass: Improve error message when no read access b60e1bbd @bep #9662
  • Fix and refactor typos 61cf3c9f @CathrinePaulsen
  • Improve server startup/shutdown 31fbc081 @bep #9671
  • commands: Improve server tests cebd886a @bep #9647

@netlify
Copy link

netlify bot commented Mar 21, 2022

✅ Deploy Preview for reporter-wax-30177 ready!

🔨 Explore the source changes: e55d68a

🔍 Inspect the deploy log: https://app.netlify.com/sites/reporter-wax-30177/deploys/623886b5ee97b800082dc7e0

😎 Browse the preview: https://deploy-preview-54--reporter-wax-30177.netlify.app

@abtris abtris merged commit 17d5457 into master Mar 22, 2022
@abtris abtris deleted the updater/version-0.95.0 branch March 22, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant