https://gohugo.io/news/0.59.0-relnotes/
The timing of this release is motivated by getting the copies of the docs repositories in synch, now fully “Hugo Modularized”. But it also comes with some very nice additions:
It is now possible to set the target format and the background fill color when processing images, e.g.:
{{ $image.Resize "600x jpg #b31280" }}
Another useful addon is the
$pages.Next
and$pages.Prev
methods on the core page collections in Hugo. These works the same way as the built-in static variants onePage
, e.g..Next
and.NextInSection
:{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}
The above is a functionally equivalent (but slightly slower) variant of:
{{with .Next }}{{.RelPermalink}}{{end}}
See Pages Methods for more information.
Notes
- Shortcode params can now be typed (supported types are
string
,bool
int
andfloat64
, see #6376.- Pages.Next/.Prev as described above has existed for a long time, but they have been undocumented. They have been reimplemented for this release and now works like their namesakes on
Page
. This may be considered a breaking change, but it should be a welcome one, as the old behaviour wasn’t very useful. See #4500