Let `hugo convert toTOML` not add unnecessary indentation

I just tried out the hugo convert toTOML command on a repo and it worked quite nicely with one nit:

I prefer my TOML not to be indented (it’s not required, avoids ‘tabs-vs-space’ debate (and how many spaces if you do use spaces), and I think it’s cleaner). I will of course, for now, post-process, but I did a search of the issues on the Hugo GitHub repo and didn’t see anyone mention this.

I wanted to ‘follow the requested procedure’ and am posting here before creating an issue for a feature request.


v1.x.x of pelletier/go-toml indented by default. When we moved to v2 we discovered the default had changed, and then promptly enabled indentation again to address this issue.

Whether one is more readable than the other is debatable. I don’t see us changing the default, so we’d have to add yet another config option.

1 Like

Hmmm… I think I’ll just post-process. Thank you for the background and the link.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.