Skip to content

Releases: gohugoio/hugo

v0.40

23 Apr 07:52
@bep bep
Compare
Choose a tag to compare

Hugo 0.40 is The Revival of the Shortcodes. Shortcodes is one of the prime features in Hugo. Really useful, but it has had some known shortcomings. @bep has been really busy the last week to address those.

In summary:

  • .Content for a page retrieved in a query in a shortcode is now almost always available. Note that shortcodes can include content that can include shortcodes that can include content... It is possible to bite your tail. See more below.
  • Shortcodes are now processed and rendered in their order of appearance.
  • Related to the above, we have now added a zero-based .Ordinal to the shortcode.

The first bullet above resolves some surprising behaviour when reading other pages' content from shortcodes. Before this release, that behaviour was undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get the current shortcode's page's rendered content. That would have impressed Einstein.

The new and well defined rules are:

  • .Page.Content from a shortcode will be empty. The related .Page.Truncated .Page.Summary, .Page.WordCount, .Page.ReadingTime, .Page.Plain and .Page.PlainWords will also have empty values.
  • For other pages (retrieved via .Page.Site.GetPage, .Site.Pages etc.) the .Content is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
  • .Page.TableOfContents is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the .Content will be empty. Run hugo -v for more information.

This release represents 19 contributions by 3 contributors to the main Hugo code base.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 13 contributions by 6 contributors. A special thanks to @kaushalmodi, @anthonyfok, @bep, and @regisphilibert for their work on the documentation site.

Hugo now has:

Notes

  • We have added a timeout configuration setting. This is currently only used to time out the .Content creation, to bail out of recursive recursions. Run hugo -v to see potential warnings about this. The timeout is set default to 10000 (10 seconds).

Enhancements

Templates

Other


Automated with GoReleaser
Built with go version go1.10.1 linux/amd64

v0.39

16 Apr 07:36
@bep bep
Compare
Choose a tag to compare

Nat King Cole was a fantastic American jazz pianist. When his bass player had visited the bar a little too often, he started with his percussive piano playing to keep the tempo flowing. Oscar Peterson called it "Nat's stabilizers". This release is the software equivalent of that. We have been doing frequent main releases this year, but looking back, the patch releases that followed them seemed unneeded. And looking at the regressions, most of them stem from the commands package, a package that before this release was filled with globals and high coupling. This package is now rewritten and accompanied with decent test coverage.

But this release isn't all boring and technical: It includes several important bug fixes, several useful new template functions, and Resource.Content allows you to get any resource's content without having to fiddle with file paths and readFile.

This release represents 61 contributions by 4 contributors to the main Hugo code base. A shout-out to @bep for the implementation and @it-gro and @RickCogley for the help testing it.

@bep leads the Hugo development with a significant amount of contributions and his witty Norwegian humour, but also a big shoutout to @anthonyfok, @thedodobird2, and @neurocline for their ongoing contributions.
And a big thanks to @digitalcraftsman for his relentless work on keeping the themes site in pristine condition and to @kaushalmodi for his great work on the documentation site.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 6 contributions by 5 contributors. A special thanks to @kaushalmodi, @regisphilibert, @bep, and @tomanistor for their work on the documentation site.

Hugo now has:

Notes

  • The main.Execute function now returns a Response object and the global Hugo variable is removed. This is only relevant for people building some kind of API around Hugo.
  • Remove deprecated File.Bytes 94c8b29c @bep

Enhancements

Templates

Other

Fixes

Read more

v0.38.2

09 Apr 08:26
@bep bep
Compare
Choose a tag to compare

This is a bug-fix release with a couple of important fixes:

Also in this release:


Automated with GoReleaser
Built with go version go1.10 linux/amd64

v0.38.1

05 Apr 16:40
@bep bep
Compare
Choose a tag to compare

This is a bug-fix that is mainly motivated by some issues with server live reloading introduced in Hugo 0.38.

This release also contains some improvements:


Automated with GoReleaser
Built with go version go1.10 linux/amd64

v0.38

02 Apr 11:07
@bep bep
Compare
Choose a tag to compare

Hugo 0.38 is an Easter egg filled with good stuff. We now support fetching date and slug from the content filename, making the move from Jekyll even easier. And you can now set contentDir per language with intelligent merging, and themes can now provide configuration ... Also worth mentioning is several improvements in the Chroma highlighter, most notable support for Go templates.

We are working hard to get the documentation up-to-date with the new features, but you can also see them in action with the full source at hugotest.bep.is.

This release represents 39 contributions by 4 contributors to the main Hugo code base.
@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @anthonyfok, @felicianotech, and @paulcmal for their ongoing contributions.

And a big thanks to @digitalcraftsman for his relentless work on keeping the themes site in pristine condition and to @kaushalmodi for his great work on the documentation site.

Also, a shoutout to @regisphilibert for his work on the new Code Toggle Shortcode on the Hugo docs site, which we will put to good use to improve all the configuration samples.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 55 contributions by 18 contributors. A special thanks to @kaushalmodi, @bep, @xa0082249956, and @paulcmal for their work on the documentation site.

Hugo now has:

Notes

  • Hugo now allows partial redefinition outputs in your site configuration. This is what most people would expect, but it is still a change in behaviour. For details, see #4487
  • Before this release, Hugo flattened URLs of processed images in sub-folders. This worked fine but was not intentional. See #4502.

Enhancements

Fixes


Automated with GoReleaser
Built with go version go1.10 linux/amd64

v0.37.1

07 Mar 18:00
@bep bep
Compare
Choose a tag to compare

This is a bug-fix release with a one important fix:

Image content such as SVG cannot be scaled with the built-in image processing methods, but it should still be possible to use them as page resources. This was a regression in Hugo 0.37 and is now fixed. ba94abbf @bep #4455


Automated with GoReleaser
Built with go version go1.10 linux/amd64

v0.37

27 Feb 09:20
@bep bep
Compare
Choose a tag to compare

The main item in Hugo 0.37 is that we now properly preserve the colour palette when processing PNG images. We got reports from users experiencing their PNG images getting bigger in file size when scaled down. Now, if you, as an example, start out with a carefully chosen 8 bit colour palette (i.e. PNG-8), this is now what you will end up with. A special thanks to @aitva for doing the investigative work finding a proper fix for this issue.

This release represents 40 contributions by 5 contributors to the main Hugo code base.

@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @vassudanagunta, @kaushalmodi, and @curttimson for their ongoing contributions.

And as always a big thanks to @digitalcraftsman for his relentless work on keeping the documentation and the themes site in pristine condition.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 24 contributions by 8 contributors. A special thanks to @bep, @4RU, @kaushalmodi, and @mitchchn for their work on the documentation site.

Hugo now has:

Notes

  • Hugo will now convert non-string YAML map keys to string. See #4393 for more information. You will get a WARNING in the console if you are touched by this.
  • We have improved the PNG processing, and have incremented the version numbers on the URL for the processed PNG image. This will just work, but you may want to run hugo --gc to clean up some old stale images in the resource cache.

Enhancements

Templates

  • Add template func for TOML/JSON/YAML docs examples conversion. This is mainly motivated by the needs of the Hugo docs site. d382502d @bep #4389

Core

Other

Fixes

Core

Other


Automated with GoReleaser
Built with go version go1.10 linux/amd64

v0.36.1

15 Feb 09:12
@bep bep
Compare
Choose a tag to compare

This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page:

{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := $big.Resize "512x" }}
{{ end }}

There would be timing issues making Hugo in some cases trying to process the same image twice at the same time.

You would experience errors of type:

png: invalid format: not enough pixel data

This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work.

The current workaround before this fix is to always operate on the original:

{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := .Fill "512x256 top" }}
{{ end }}

This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user.


Automated with GoReleaser
Built with go version go1.9.4 linux/amd64

v0.36

05 Feb 15:50
@bep bep
Compare
Choose a tag to compare

Hugo 0.36 announces smart cropping of images, using the library created by muesli. We will work with him to improve this even more in the future, but this is now the default used when cropping images in Hugo.

Go here for a list of examples.

This release represents 7 contributions by 3 contributors to the main Hugo code base.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 9 contributions by 4 contributors. A special thanks to @bep, @Jibec, @Nick-Rivera, and @kaushalmodi for their work on the documentation site.

Hugo now has:

Notes

Hugo now defaults to smart crop when cropping images, if you don't specify it when calling .Fill.

You can get the old default by adding this to your config.toml:

[imaging]
anchor = "center"

Also, we have removed the superflous anchor name from the processed filenames that does not use this anchor, so it can be wise to run hugo --gc once to remove unused images.

Enhancements

Fixes


Automated with GoReleaser
Built with go version go1.9.3 linux/amd64

v0.35

31 Jan 10:48
@bep bep
Compare
Choose a tag to compare

The most notable new feature in Hugo 0.35 is perhaps Headless Bundles.

This means that you in your index.md front matter can say:

headless: true

And

  • it will have no Permalink and no rendered HTML in /public
  • it will not be part of .Site.RegularPages etc.

But you can get it by:

  • .Site.GetPage ...

The use cases are many:

  • Shared media libraries
  • Reusable page content "snippets"
  • ...

But this release contains more goodies than possible to sum up in one paragraph, so study the release notes carefully. It represents 42 contributions by 8 contributors to the main Hugo code base.

@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @vassudanagunta, @yanzay, and @robertbasic for their ongoing contributions.

And as always a big thanks to @digitalcraftsman for his relentless work on keeping the documentation and the themes site in pristine condition.

Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 28 contributions by 5 contributors. A special thanks to @bep, @kaushalmodi, @regisphilibert, and @salim-b for their work on the documentation site.

Hugo now has:

Notes

Enhancements

Templates

Other

Fixes

Read more