diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-08-07 19:56:02 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-08-08 09:13:17 +0200 |
commit | 7d74cd0cc88716fba813e9e2e229c3b22b828b5f (patch) | |
tree | e07eae705148988da70e54cb48ec426c3b0a375a /commands | |
parent | d139f30234cbc60fef8a49611189519d40336dbe (diff) | |
download | hugo-7d74cd0cc88716fba813e9e2e229c3b22b828b5f.tar.gz hugo-7d74cd0cc88716fba813e9e2e229c3b22b828b5f.zip |
commands: Handle floats without decimals in hugo config
Updates #11345
Diffstat (limited to 'commands')
-rw-r--r-- | commands/config.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/config.go b/commands/config.go index 9bf1c0961..63ee4f7c8 100644 --- a/commands/config.go +++ b/commands/config.go @@ -23,6 +23,7 @@ import ( "time" "github.com/bep/simplecobra" + "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/config/allconfig" "github.com/gohugoio/hugo/modules" "github.com/gohugoio/hugo/parser" @@ -92,6 +93,7 @@ func (c *configCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg if err := json.Unmarshal(buf.Bytes(), &m); err != nil { return err } + maps.ConvertFloat64WithNoDecimalsToInt(m) switch format { case "yaml": return parser.InterfaceToConfig(m, metadecoders.YAML, os.Stdout) |