# Let \`hugo convert toTOML\` not add unnecessary indentation

**URL:** <https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002>\
**Category:** feature\
**Tags:** cli\
**Created:** [August 14, 2022, 10:30pm UTC](https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002 "2022-08-14T22:30:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [August 14, 2022, 10:30pm UTC](https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002/1 "2022-08-14T22:30:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 15, 2022, 1:00am UTC](https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002/2 "2022-08-15T01:00:10Z")

</div>

Background…

v1.x.x of [pelletier/go-toml](https://github.com/pelletier/go-toml/) indented by default. When we [moved to v2](https://github.com/gohugoio/hugo/pull/8815/) we discovered the default had changed, and then promptly [enabled indentation again](https://github.com/gohugoio/hugo/commit/9bba9a3a98fa268391597d8d7a52112fb401d952) to address [this issue](https://github.com/gohugoio/hugoDocs/issues/1505).

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.

---

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [August 15, 2022, 1:22am UTC](https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002/3 "2022-08-15T01:22:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [August 17, 2022, 1:22am UTC](https://discourse.gohugo.io/t/let-hugo-convert-totoml-not-add-unnecessary-indentation/40002/4 "2022-08-17T01:22:56Z")

</div>

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