Hello,
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
.
Details
Here is the media type and output format definition for atom feed in my site config:
[mediaTypes]
[mediaTypes."application/atom"]
suffix = "xml"
[outputFormats.Atom]
# 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
[outputs]
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 outputformatname
was all-lowercase “atom”).
All of that just because I capitalized the outputformat name
?
Screenshots
Working case (with name = "atom"
)
Failing case (with name = "Atom"
)