UNCLASSIFIED - NO CUI

Skip to content

Update dependency gohugoio/hugo to v0.90.1

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.89.4 -> v0.90.1
gohugoio/hugo minor v0.89.4 -> v0.90.1

Release Notes

gohugoio/hugo

v0.90.1

Compare Source

This release contains some fixes and improvements related to error handling in remote lookups in resources.Get, as introduced in Hugo 0.90.0:

  • Now we will always return nil (never fail the build) when a resource is not found, also for remote resources (HTTP status code 404). This means that you can do {{ with $img }}{{ else }}{{/* insert a default image or something */}}{{ end }} and similar constructs, not having to consider where the resource source lives.
  • Fetching resources remotely over HTTPS has a much greater chance of failing (network down, server down) than reading a file from disk (if not already cached). And having this lead to a failing build is not always optimal. This release allows you to handle/ignore these errors in the templates if needed, see details below.

The return value from resources.Get now includes an .Err method that will be set if the call failed. If you want to just log any error as a WARNING you can use a construct similar to the one below.

{{ with resources.Get "https://gohugo.io/images/gohugoio-card-1.png" }}
  {{ with .Err }}
    {{ warnf "%s" . }}
  {{ else }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
{{ end }}

Note that if you do not handle .Err yourself, Hugo will fail the build the first time you start using the failed Resource object.

Changes

v0.90.0

Compare Source

Hugo 0.90 finally brings remote support to resources.Get, XML support (in /data and transform.Unmarshal), and a new images.Text filter. A special shoutout and thanks to @​vanbroup for his work on these features.

The support for remote Resources in resources.Get has been a feature in great demand. This means that you can fetch remote files (images, JSON files, RSS feeds ...) and use them in Hugo Pipes functions as they were local. A contrived example may look like this:

{{ $font := resources.Get "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
{{ $img := resources.Get "https://gohugo.io/images/gohugoio-card-1.png" }}
{{ $img = $img | images.Filter (images.Text 
                        "Rocks!" 
                        (dict 
                            "color" "#E6B405" 
                            "size" 100
                            "lineSpacing" 8 
                            "x" 400 "y" 320
                            "font" $font))
                     
}}
<img src="{{ $img.RelPermalink }}" />

The above fetches both a font and an image remotely and then uses the new images.Text filter to overlay a text on top of the image.

Numbers

This release represents 58 contributions by 6 contributors to the main Hugo code base.@​bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @​jmooring, @​vanbroup, and @​dependabot[bot] for their ongoing contributions.

And thanks to @​digitalcraftsman for his ongoing work on keeping the themes site in pristine condition.

Many have also been busy writing and fixing the documentation in hugoDocs, which has received 17 contributions by 6 contributors. A special thanks to @​jmooring, @​bep, @​santosh, and @​coliff for their work on the documentation site.

Hugo now has:

Notes
Changes

Configuration

📅 Schedule: 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