]> git.maquefel.me Git - brevno-suite/hugo/commit
commands: newDocsHelper encode integers as ints in generated YAML
authorAlexandru Grigore <GrigoreAlexandru.dev@gmail.com>
Sun, 9 Nov 2025 19:41:45 +0000 (21:41 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 9 Nov 2025 22:01:16 +0000 (23:01 +0100)
commit0efcb24c37c30dde7f5476279dc2451a1af481ce
tree98eb9e4a049a21854cedd64fe8b8452518197872
parente1236e3d0da7daed64819ae2e602793125b2d9cc
commands: newDocsHelper encode integers as ints in generated YAML

Previously the JSON -> map roundtrip produced float64 values which caused the YAML encoder to emit integers like 404.0 instead of 404. Use the YAML encoder option yaml.AutoInt() so numbers that are integer-valued are encoded as integers.

This change affects the
ewDocsHelper command (commands/gen.go) where the docs data is written to docs/data/docs.yaml. After this change generated YAML will contain integer values (e.g. status: 404) instead of floats (e.g. status: 404.0).

Fixes #14122
commands/gen.go