aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser/frontmatter.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-08-04 11:33:30 +0200
committerBjørn Erik Pedersen <[email protected]>2021-08-04 11:39:16 +0200
commit9bba9a3a98fa268391597d8d7a52112fb401d952 (patch)
tree3995a81a85377b20da92aa33b9d1a536699311c9 /parser/frontmatter.go
parentd6c8cd771834ae2913658c652e30a9feadc2a7b7 (diff)
downloadhugo-9bba9a3a98fa268391597d8d7a52112fb401d952.tar.gz
hugo-9bba9a3a98fa268391597d8d7a52112fb401d952.zip
parser: Indent TOML tables
Fixes #8850
Diffstat (limited to 'parser/frontmatter.go')
-rw-r--r--parser/frontmatter.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser/frontmatter.go b/parser/frontmatter.go
index e7492745e..79701a0fc 100644
--- a/parser/frontmatter.go
+++ b/parser/frontmatter.go
@@ -46,7 +46,9 @@ func InterfaceToConfig(in interface{}, format metadecoders.Format, w io.Writer)
return err
case metadecoders.TOML:
- return toml.NewEncoder(w).Encode(in)
+ enc := toml.NewEncoder(w)
+ enc.SetIndentTables(true)
+ return enc.Encode(in)
case metadecoders.JSON:
b, err := json.MarshalIndent(in, "", " ")
if err != nil {