Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-04 12:33:30 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-04 12:39:16 +0300
commit9bba9a3a98fa268391597d8d7a52112fb401d952 (patch)
tree3995a81a85377b20da92aa33b9d1a536699311c9 /parser
parentd6c8cd771834ae2913658c652e30a9feadc2a7b7 (diff)
parser: Indent TOML tables
Fixes #8850
Diffstat (limited to 'parser')
-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 {