Bug: Empty Content in "atom.xml" alternative output if outputformat name is capitalized


I got atom feed generation for my site working fine. But in that process I discovered this strange behavior (most likely a bug)… that I cannot capitalize outputformat name.

Note that I am running the master branch built version of hugo.


Here is the media type and output format definition for atom feed in my site config:

    suffix = "xml"

  # https://validator.w3.org/feed/docs/atom.html#whatIsAtom
  name = "atom"
  mediaType = "application/atom"
  baseName = "atom" # generated file = <baseName>.<mediaType."application/atom".suffix> = atom.xml
  isPlainText = false

  home = ["HTML", "RSS", "ATOM"] # default = ["HTML", "RSS"]

The atom feed generates fine (the atom.xml), as expected, based on this list.atom.xml template.

But if I simply change name = "atom" to name = "Atom" (test commit), strange behavior ensues:

Everything in that template still seems to work fine except that the most important part, .Content insertion has issues… this line in the template:

{{ printf "<content type=\"html\"><![CDATA[%s]]></content>" .Content | safeHTML }}

Running hugo server:

  • Initially the atom feed gets generated with empty content, as if .Content were “”.
  • But if I modify and save the list.atom.xml while the server is running, the content gets inserted fine!

Running hugo:

  • Here, as there is no chance to regenerate like in the server case, the atom feed will always have empty content.
  • You can see the “content-less” atom feed here generated on Netlify using that commit where I capitalized name value (vs the “content-full” atom.xml where the outputformat name was all-lowercase “atom”).

All of that just because I capitalized the outputformat name?


Working case (with name = "atom")


Failing case (with name = "Atom")


Fun fact: This issue is not seen when setting name to any variance of casing with the condition that the first letter is always lower-case: "aTOM", "aTom","aTOm", …

The issue occurs only seen when the first letter is capital i.e. "Atom", "ATOM", "ATOm", …

It’s easy to switch back and forth those 2 cases, with hugo server running, and editing/saving just that name assignment in config.toml.

But note that if I modify and save the list.atom.xml instead while the server is running, the issue goes away… until I kill and restart the server.