Hugo 0.21 Released

Spread the word:


Awesome stuff. I have a Docker image updated:

I love how frequent we’re seeing releases with improvements. Very motivating.

Also, is the Twitter profile photo suppose to be cut off like that?

That is Twitters work, but we should do something about the proportions; with the new Hugo site coming, we get a blog that we can post these release notes and can get better control of it all.

1 Like

Good news !

I have release the rpm package for 0.21 :


Another great release!

Out of curiosity, why does the NumFmt function has to be prefixed with lang? (As opposed to other language-sensitive functions, like dateFormat and humanize.)

I initially thought lang stands for language, but changing the default language (with DefaultContentLanguage in config.toml) has no impact on the default output of the NumFmt function. (I switched from a language that prints large numbers like this: 10,000.34 to one that uses 10.000,34).

So the lang namespace requirement for the NumFmt function got me a bit confused here! :slightly_smiling:

We had to get some order into the template funcs – we have so many now, so we created namespaces. Most template funcs have aliases (collections.Where => where), but we decided to just let lang.NumFmt live without it. All of this will make it easier to test, document etc. – and we can just add more as needed without too much worry. And when we have just wrapped existing Go funcs, we have in many cases kept the exact name (including the Go package), i.e. strings.HasPrefix.

Ah I see, thanks for clarifying.

From a usability standpoint for new users and to lessen the learning curve, would it be an idea to add an alias for NumFmt too? (lang.NumFmt => numFmt).

That keeps the function naming consistent, and gives less to document.

It might also remove the suggestion that lang is an object and numFmt a method (for new users with JavaScript background). Or that lang is related to the .Lang and .Language template variables, or Hugo’s multilingual mode.