Hidden new feature

There is a hidden and very useful new feature in this commit (coming in the next Hugo):

It would be cool if someone could guess what it is and verify that it works … :slight_smile:

1 Like

Something to do with maps?

1 Like

alphabetical sorting somewhere where it was not possible?

Yes it is.

Awesome but https://github.com/mitchellh/mapstructure has no release notes, so I guess that’s all I’ll be able to guess.

I know what I want though: Maps whose keys are ordered in accordance with the argument order of slice and dict.

So that will be my guess.

OK, you’re not going to figure it out.

It is the map support in the cast library.

I have not tested this myself, but it should make it possible to set params in config.toml via OS env variables, something ala:

HUGO_PARAMS="{\"param1\": \"Some Value\"}" hugo

But I have not tested this, yet …

2 Likes

The above may look exotic, but it has been a recurring questions here on the forum.

Nerver had the use case myself, but I can see how convenient it can ben when needing many env variables.

I thought, this was the feature: https://github.com/mitchellh/mapstructure/commit/1241c370bce5018324ddfc93cae48e56d1405764

Would have been great if we could convert structs to maps in templates :slight_smile:

What use case? To range over it?

Yes, that’s what I was thinking. Debugging arbitrary structs (GitInfo, FileInfo, SiteInfo, etc) will get then so much easier.