Skip to content

v0.120.0

Compare
Choose a tag to compare
@bep bep released this 30 Oct 14:28

This is a full dependency refresh and a couple of new cool features:

A new Padding image filter, and a new debug.Timer template func. The new debug.Timer is useful for finding performance bottle necks in templates:

{{ $timer := debug.Timer "slowTemplate" }}
// ...
{{ $timer.Stop }}

If you then run hugo --logLevel info you should see timer info logged at the end of the build. You can have as many timers as you want and if you don't stop them, they will be stopped at the end of build.

Hugo now also builds release binaries for Solaris now that a long-living issue in the upstream ƒsnotify library has been fixed, thanks to @nshalman.

Notes

  • The enableEmoji flag now only works for Markdown content. This is unfortunate, but the old solution has some known issues and it was too hard to make it work properly as a general thing across all formats. See #11598
  • site.DisqusShortname is deprecated 2eca1b3
  • site.GoogleAnalytics is deprecated a692278
  • site.Author is deprecated d4016dd
  • site.Social is deprecated 4910312

Also, we have changed the string type for some of the fields and methods:

  • .Fragments.ToHTML now returns template.HTML
  • $resource.Data.Integrity now returns a string and not a template.HTMLAttr
  • delimit now returns a string and not a template.HTML See #10876 #11502.
  • the URL functions now returns a string, see #11536
  • The paginator Pager now returns a string.
  • site.BaseURL now returns a string.

The above should both solve some issues and make the above types more useful and easer to reason about. But if you use the delimit function to process HTML and see some unexpected escaping after this release, e.g.:

{{ $s := slice "<i>foo</i>" }}
{{ delimit $s "," }}

Then you need to mark the type with safeHTML:

{{ $s := slice "<i>foo</i>" }}
{{ delimit $s "," | safeHTML }}

Bug fixes

Improvements

Dependency Updates

Documentation