The above looks like a good candidate for https://github.com/gohugoio/hugo/issues/5455
Looks easy to grasp.
@lpar I have already opened an issue about metadata manipulation in Hugo after using your utility see:
Would these make it possible to render a PDF from Hugo?
It would be awesome if Hugo’s supported target image formats included JPEG 2000 and/or WebP.
The new hot shit for images
Very interesting
In particular…
func Keys
Keys returns the keys of the map m. The keys will be in an indeterminate order.func Values
Values returns the values of the map m. The values will be in an indeterminate order.
We can get to the data now, but this would be convenient at times.
Given this map:
{
"a": "aaaaa",
"b": "bbbbb"
}
To get the keys we need to:
{{ $keys := slice }}
{{ range $k, $v := $m }}
{{ $keys = $keys | append $k }}
{{ end }}
It would be nice to do:
{{ $keys := maps.Keys $m }}
Same with values…
Update 30 Dec 2023: maps.Keys and maps.Values were removed when introducing https://pkg.go.dev/maps in Go 1.21.
I think that package is Go 1.18 (which is in beta 2 at the moment), but I do agree that the above would be useful. I think Go 1.18 will be one of those releases where we will probably skip the “Hugo supports the last 2 Go versions …”, because there are too much cool stuff to ignore …
oooooh AVIF!