PR #14934 drops empty sub-maps from hugo config output to reduce noise. However, this also removes contentTypes, whose entries are intentionally empty — they have no per-type options, so ContentTypeConfig is an empty struct by design.
Proposed fix: in removeZeroVAlues, distinguish between maps that are originally empty (intentional, preserve them) and maps that became empty after their zero-valued entries were stripped (noise, remove them). The #14934 behavior is otherwise unchanged.
With this fix, hugo config output includes the contentTypes section regardless of output format, restoring the behavior from v0.161.1. Users who discovered the --printZero workaround would no longer need it for this section.
For example, this command:
hugo config --format toml | grep -i contentTypes
Should produce this output:
[contenttypes]
[contenttypes.'text/asciidoc']
[contenttypes.'text/html']
[contenttypes.'text/markdown']
[contenttypes.'text/org']
[contenttypes.'text/pandoc']
[contenttypes.'text/rst']
Without this functionality it is difficult to determine which are enabled/disabled.
PR #14934 drops empty sub-maps from
hugo configoutput to reduce noise. However, this also removescontentTypes, whose entries are intentionally empty — they have no per-type options, soContentTypeConfigis an empty struct by design.Proposed fix: in
removeZeroVAlues, distinguish between maps that are originally empty (intentional, preserve them) and maps that became empty after their zero-valued entries were stripped (noise, remove them). The #14934 behavior is otherwise unchanged.With this fix,
hugo configoutput includes thecontentTypessection regardless of output format, restoring the behavior from v0.161.1. Users who discovered the--printZeroworkaround would no longer need it for this section.For example, this command:
hugo config --format toml | grep -i contentTypesShould produce this output:
Without this functionality it is difficult to determine which are enabled/disabled.